]> granicus.if.org Git - python/log
python
17 years agoAdding Christian Heimes.
Martin v. Löwis [Wed, 31 Oct 2007 17:19:33 +0000 (17:19 +0000)]
Adding Christian Heimes.

17 years agoFix some compiler warnings for signed comparisons on Unix and Windows.
Neal Norwitz [Wed, 31 Oct 2007 06:33:20 +0000 (06:33 +0000)]
Fix some compiler warnings for signed comparisons on Unix and Windows.

17 years agoMake example about hiding None return values at the prompt clearer.
Georg Brandl [Tue, 30 Oct 2007 17:57:12 +0000 (17:57 +0000)]
Make example about hiding None return values at the prompt clearer.

17 years agoUse correct markup.
Georg Brandl [Tue, 30 Oct 2007 17:51:18 +0000 (17:51 +0000)]
Use correct markup.

17 years agocheck in Tal Einat's update to tabpage.py
Kurt B. Kaiser [Tue, 30 Oct 2007 02:38:54 +0000 (02:38 +0000)]
check in Tal Einat's update to tabpage.py
Patch 1612746

M    configDialog.py
M    NEWS.txt
AM   tabbedpages.py

17 years agoBackport fixes for the code that decodes octal escapes (and for PyString
Guido van Rossum [Mon, 29 Oct 2007 22:15:05 +0000 (22:15 +0000)]
Backport fixes for the code that decodes octal escapes (and for PyString
also hex escapes) -- this was reaching beyond the end of the input string
buffer, even though it is not supposed to be \0-terminated.
This has no visible effect but is clearly the correct thing to do.
(In 3.0 it had a visible effect after removing ob_sstate from PyString.)

17 years agoPatch 1353 by Jacob Winther.
Guido van Rossum [Mon, 29 Oct 2007 20:52:45 +0000 (20:52 +0000)]
Patch 1353 by Jacob Winther.
Add mp4 mapping to mimetypes.py.

17 years agoAdd confirmation dialog before printing. Patch 1717170 Tal Einat.
Kurt B. Kaiser [Sun, 28 Oct 2007 19:03:59 +0000 (19:03 +0000)]
Add confirmation dialog before printing.  Patch 1717170 Tal Einat.

17 years agoEnable platform-specific tweaks for FreeBSD 8 (exactly same to FreeBSD 7's yet)
Hye-Shik Chang [Sun, 28 Oct 2007 12:38:09 +0000 (12:38 +0000)]
Enable platform-specific tweaks for FreeBSD 8 (exactly same to FreeBSD 7's yet)

17 years ago- Add support for FreeBSD 8 which is recently forked from FreeBSD 7.
Hye-Shik Chang [Sun, 28 Oct 2007 11:19:02 +0000 (11:19 +0000)]
- Add support for FreeBSD 8 which is recently forked from FreeBSD 7.
- Regenerate IN module for most recent maintenance tree of FreeBSD 6 and 7.

17 years agoUpdate URL for Pygments. 0.8.1 is no longer available
Neal Norwitz [Sat, 27 Oct 2007 22:32:21 +0000 (22:32 +0000)]
Update URL for Pygments.  0.8.1 is no longer available

17 years agoFix new pop() method on os.environ on ignorecase-platforms.
Georg Brandl [Fri, 26 Oct 2007 18:30:41 +0000 (18:30 +0000)]
Fix new pop() method on os.environ on ignorecase-platforms.

17 years ago1. Add comments to provide top-level documentation.
Kurt B. Kaiser [Fri, 26 Oct 2007 00:10:09 +0000 (00:10 +0000)]
1. Add comments to provide top-level documentation.
2. Refactor to use more descriptive names.
3. Enhance tests in main().

17 years agoCorrect an ancient bug in an unused path by removing that path: register() is
Kurt B. Kaiser [Thu, 25 Oct 2007 22:43:45 +0000 (22:43 +0000)]
Correct an ancient bug in an unused path by removing that path: register() is
now idempotent.

17 years agoffi_type_longdouble may be already #defined.
Thomas Heller [Thu, 25 Oct 2007 19:47:32 +0000 (19:47 +0000)]
ffi_type_longdouble may be already #defined.
See issue 1324.

17 years ago- Build using system ffi library on arm*-linux*, pass --with-system-ffi to CONFIG_ARGS
Matthias Klose [Thu, 25 Oct 2007 06:37:24 +0000 (06:37 +0000)]
- Build using system ffi library on arm*-linux*, pass --with-system-ffi to CONFIG_ARGS

17 years agoMissing DECREFs
Raymond Hettinger [Thu, 25 Oct 2007 02:26:58 +0000 (02:26 +0000)]
Missing DECREFs

17 years agoBug #1287: make os.environ.pop() work as expected.
Georg Brandl [Wed, 24 Oct 2007 21:40:38 +0000 (21:40 +0000)]
Bug #1287: make os.environ.pop() work as expected.

17 years ago- Build using system ffi library on arm*-linux*.
Matthias Klose [Wed, 24 Oct 2007 20:00:44 +0000 (20:00 +0000)]
- Build using system ffi library on arm*-linux*.

17 years agoAdded unittest for calling a function with paramflags (backport from py3k branch).
Thomas Heller [Wed, 24 Oct 2007 19:50:45 +0000 (19:50 +0000)]
Added unittest for calling a function with paramflags (backport from py3k branch).

17 years agoIssue 1290. CharacterData.__repr__ was constructing a string
Facundo Batista [Wed, 24 Oct 2007 19:11:08 +0000 (19:11 +0000)]
Issue 1290.  CharacterData.__repr__ was constructing a string
in response that keeped having a non-ascii character.

17 years agoBug #1321: Fixed logic error in TimedRotatingFileHandler.__init__()
Vinay Sajip [Wed, 24 Oct 2007 10:47:06 +0000 (10:47 +0000)]
Bug #1321: Fixed logic error in TimedRotatingFileHandler.__init__()

17 years agoFixup error return and add support for intermixed ints and floats/
Raymond Hettinger [Wed, 24 Oct 2007 02:05:51 +0000 (02:05 +0000)]
Fixup error return and add support for intermixed ints and floats/

17 years agoOptimize sum() for integer and float inputs.
Raymond Hettinger [Wed, 24 Oct 2007 01:28:33 +0000 (01:28 +0000)]
Optimize sum() for integer and float inputs.

17 years agoFixup news entry
Raymond Hettinger [Tue, 23 Oct 2007 21:23:07 +0000 (21:23 +0000)]
Fixup news entry

17 years agoUpdate name
Andrew M. Kuchling [Tue, 23 Oct 2007 20:55:47 +0000 (20:55 +0000)]
Update name

17 years agoShorter name for namedtuple()
Raymond Hettinger [Tue, 23 Oct 2007 20:37:41 +0000 (20:37 +0000)]
Shorter name for namedtuple()

17 years agoIssue 1307 by Derek Shockey, fox the same bug for RCPT.
Guido van Rossum [Tue, 23 Oct 2007 19:25:41 +0000 (19:25 +0000)]
Issue 1307 by Derek Shockey, fox the same bug for RCPT.
Neal: please backport!

17 years agoUpdate Pygments version from externals.
Georg Brandl [Tue, 23 Oct 2007 18:21:35 +0000 (18:21 +0000)]
Update Pygments version from externals.

17 years agoBug #1313, fix typo (wrong variable name) in example.
Neal Norwitz [Tue, 23 Oct 2007 05:44:27 +0000 (05:44 +0000)]
Bug #1313, fix typo (wrong variable name) in example.

17 years agoAdd phuang patch from Issue 708374 which adds offset parameter to mmap module.
Travis E. Oliphant [Tue, 23 Oct 2007 02:40:56 +0000 (02:40 +0000)]
Add phuang patch from Issue 708374 which adds offset parameter to mmap module.

17 years agoIssue #1307, patch by Derek Shockey.
Guido van Rossum [Mon, 22 Oct 2007 16:27:19 +0000 (16:27 +0000)]
Issue #1307, patch by Derek Shockey.
When "MAIL" is received without args, an exception happens instead of
sending a 501 syntax error response.

17 years agoAdd Chris Monson so he can edit PEPs.
Neal Norwitz [Mon, 22 Oct 2007 04:47:54 +0000 (04:47 +0000)]
Add Chris Monson so he can edit PEPs.

17 years agoAdd :term:s for "new-style class".
Georg Brandl [Sun, 21 Oct 2007 12:15:05 +0000 (12:15 +0000)]
Add :term:s for "new-style class".

17 years agoAdd :term:s for iterator.
Georg Brandl [Sun, 21 Oct 2007 12:10:28 +0000 (12:10 +0000)]
Add :term:s for iterator.

17 years agoAdd :term: for generators.
Georg Brandl [Sun, 21 Oct 2007 10:52:38 +0000 (10:52 +0000)]
Add :term: for generators.

17 years agoUnify "file-descriptor" to "file descriptor".
Georg Brandl [Sun, 21 Oct 2007 10:46:24 +0000 (10:46 +0000)]
Unify "file-descriptor" to "file descriptor".

17 years agoAdd :term:s for descriptors.
Georg Brandl [Sun, 21 Oct 2007 10:45:46 +0000 (10:45 +0000)]
Add :term:s for descriptors.

17 years agoAdd markup to new function descriptions.
Georg Brandl [Sun, 21 Oct 2007 10:32:54 +0000 (10:32 +0000)]
Add markup to new function descriptions.

17 years agoUnify "byte code" to "bytecode". Also sprinkle :term: markup for it.
Georg Brandl [Sun, 21 Oct 2007 10:24:20 +0000 (10:24 +0000)]
Unify "byte code" to "bytecode". Also sprinkle :term: markup for it.

17 years agoRemove duplicate crasher.
Georg Brandl [Sun, 21 Oct 2007 10:01:56 +0000 (10:01 +0000)]
Remove duplicate crasher.

17 years agoAdd a crasher for the long-standing issue with closing a file
Armin Rigo [Sun, 21 Oct 2007 09:14:15 +0000 (09:14 +0000)]
Add a crasher for the long-standing issue with closing a file
while another thread uses it.

17 years agoUse correct header line
Andrew M. Kuchling [Sat, 20 Oct 2007 19:39:35 +0000 (19:39 +0000)]
Use correct header line

17 years agoVarious items
Andrew M. Kuchling [Sat, 20 Oct 2007 19:35:18 +0000 (19:35 +0000)]
Various items

17 years agoFix protocol name
Andrew M. Kuchling [Sat, 20 Oct 2007 19:25:37 +0000 (19:25 +0000)]
Fix protocol name

17 years agoEven more clarification.
Georg Brandl [Sat, 20 Oct 2007 19:08:36 +0000 (19:08 +0000)]
Even more clarification.

17 years agoClarify -E docs.
Georg Brandl [Sat, 20 Oct 2007 19:05:45 +0000 (19:05 +0000)]
Clarify -E docs.

17 years agoAdd entry to ACKS.
Georg Brandl [Sat, 20 Oct 2007 18:39:25 +0000 (18:39 +0000)]
Add entry to ACKS.

17 years agoChange title, for now.
Georg Brandl [Sat, 20 Oct 2007 18:33:20 +0000 (18:33 +0000)]
Change title, for now.

17 years ago* Add new toplevel chapter, "Using Python." (how to install,
Georg Brandl [Sat, 20 Oct 2007 18:08:14 +0000 (18:08 +0000)]
* Add new toplevel chapter, "Using Python." (how to install,
  configure and setup python on different platforms -- at least
  in theory.)
* Move the Python on Mac docs in that chapter.
* Add a new chapter about the command line invocation, by stargaming.

17 years agoDocument new directive "envvar".
Georg Brandl [Sat, 20 Oct 2007 17:51:39 +0000 (17:51 +0000)]
Document new directive "envvar".

17 years agoMake a path more Unix-standardy.
Georg Brandl [Sat, 20 Oct 2007 15:21:22 +0000 (15:21 +0000)]
Make a path more Unix-standardy.

17 years agoDocument new "cmdoption" directive.
Georg Brandl [Sat, 20 Oct 2007 13:36:24 +0000 (13:36 +0000)]
Document new "cmdoption" directive.

17 years agoFix code being interpreted as a target.
Georg Brandl [Sat, 20 Oct 2007 13:22:53 +0000 (13:22 +0000)]
Fix code being interpreted as a target.

17 years agoThe constructor from tuple was way too permissive: it allowed bad
Facundo Batista [Fri, 19 Oct 2007 19:25:57 +0000 (19:25 +0000)]
The constructor from tuple was way too permissive: it allowed bad
coefficient numbers, floats in the sign, and other details that
generated directly the wrong number in the best case, or triggered
misfunctionality in the alorithms.

Test cases added for these issues. Thanks Mark Dickinson.

17 years agoFix ctypes on 32-bit systems when Python is configured --with-system-ffi.
Thomas Heller [Fri, 19 Oct 2007 18:11:41 +0000 (18:11 +0000)]
Fix ctypes on 32-bit systems when Python is configured --with-system-ffi.
See also https://bugs.launchpad.net/bugs/72505.

Ported from release25-maint branch.

17 years ago#1284: "S" means "seen", not unread.
Georg Brandl [Fri, 19 Oct 2007 17:38:49 +0000 (17:38 +0000)]
#1284: "S" means "seen", not unread.

17 years agoAdded a cross-ref to each other.
Mark Summerfield [Fri, 19 Oct 2007 12:48:17 +0000 (12:48 +0000)]
Added a cross-ref to each other.

17 years agoClarify wording for apply().
Georg Brandl [Fri, 19 Oct 2007 12:32:39 +0000 (12:32 +0000)]
Clarify wording for apply().

17 years agosquelch the warning that this test is supposed to trigger.
Gregory P. Smith [Fri, 19 Oct 2007 07:31:20 +0000 (07:31 +0000)]
squelch the warning that this test is supposed to trigger.

17 years agoRemove useless warning
Raymond Hettinger [Thu, 18 Oct 2007 21:13:06 +0000 (21:13 +0000)]
Remove useless warning

17 years agomention bsddb fixes.
Gregory P. Smith [Thu, 18 Oct 2007 17:17:57 +0000 (17:17 +0000)]
mention bsddb fixes.

17 years agoA cleaner fix than the one committed last night. Generate random rowids that
Gregory P. Smith [Thu, 18 Oct 2007 16:32:02 +0000 (16:32 +0000)]
A cleaner fix than the one committed last night.  Generate random rowids that
do not contain null bytes.

17 years agoFix a weird bug in dbtables: if it chose a random rowid string that contained
Gregory P. Smith [Thu, 18 Oct 2007 08:34:20 +0000 (08:34 +0000)]
Fix a weird bug in dbtables: if it chose a random rowid string that contained
NULL bytes it would cause the database all sorts of problems in the future
leading to very strange random failures and corrupt dbtables.bsdTableDb dbs.

17 years agocleanup test_dbtables to use mkdtemp. cleanup dbtables to pass txn as a
Gregory P. Smith [Thu, 18 Oct 2007 07:56:54 +0000 (07:56 +0000)]
cleanup test_dbtables to use mkdtemp.  cleanup dbtables to pass txn as a
keyword argument whenever possible to avoid bugs and confusion.  (dbtables.py
line 447 self.db.get using txn as a non-keyword was an actual bug due to this)

17 years agoIssue 1289, just a typo.
Facundo Batista [Thu, 18 Oct 2007 03:44:48 +0000 (03:44 +0000)]
Issue 1289, just a typo.

17 years agoIssue #1580738. When HTTPConnection reads the whole stream with read(),
Facundo Batista [Thu, 18 Oct 2007 03:16:03 +0000 (03:16 +0000)]
Issue #1580738.  When HTTPConnection reads the whole stream with read(),
it closes itself.  When the stream is read in several calls to read(n),
it should behave in the same way if HTTPConnection knows where the end
of the stream is (through self.length).  Added a test case for this
behaviour.

17 years agoFix the overflow checking of list_repeat.
Armin Rigo [Wed, 17 Oct 2007 18:46:37 +0000 (18:46 +0000)]
Fix the overflow checking of list_repeat.
Introduce overflow checking into list_inplace_repeat.

Backport candidate, possibly.

17 years agoRe-order some functions whose parameters differ between PyObject and const char
Brett Cannon [Tue, 16 Oct 2007 23:26:45 +0000 (23:26 +0000)]
Re-order some functions whose parameters differ between PyObject and const char
* so that they are next to each other.

17 years agoRemove ``:const:`` notation on None in parameter list. Since the markup is not
Brett Cannon [Tue, 16 Oct 2007 23:24:06 +0000 (23:24 +0000)]
Remove ``:const:`` notation on None in parameter list.  Since the markup is not
rendered for parameters it just showed up as ``:const:`None` `` in the output.

17 years agoAdd items
Andrew M. Kuchling [Tue, 16 Oct 2007 22:58:03 +0000 (22:58 +0000)]
Add items

17 years agoMore docs, error messages, and tests
Raymond Hettinger [Tue, 16 Oct 2007 21:28:32 +0000 (21:28 +0000)]
More docs, error messages, and tests

17 years agoImprove error messages
Raymond Hettinger [Tue, 16 Oct 2007 19:18:30 +0000 (19:18 +0000)]
Improve error messages

17 years agoChange a PyErr_Print() into a PyErr_Clear(),
Guido van Rossum [Mon, 15 Oct 2007 15:54:11 +0000 (15:54 +0000)]
Change a PyErr_Print() into a PyErr_Clear(),
per discussion in issue 1031213.

17 years agotest_bigbits was not testing what it seemed to.
Armin Rigo [Mon, 15 Oct 2007 07:48:35 +0000 (07:48 +0000)]
test_bigbits was not testing what it seemed to.

17 years agoUse unittest for assertions
Neal Norwitz [Sun, 14 Oct 2007 18:40:37 +0000 (18:40 +0000)]
Use unittest for assertions

17 years agoDon't raise a string exception, they don't work anymore.
Neal Norwitz [Sun, 14 Oct 2007 18:30:21 +0000 (18:30 +0000)]
Don't raise a string exception, they don't work anymore.

17 years agoLet the O/S supply a port if none of the default ports can be used.
Neal Norwitz [Sun, 14 Oct 2007 00:18:40 +0000 (00:18 +0000)]
Let the O/S supply a port if none of the default ports can be used.
This should make the tests more robust at the expense of allowing
tests to be sloppier by not requiring them to cleanup after themselves.
(It will legitamitely help when running two test suites simultaneously
or if another process is already using one of the predefined ports.)

Also simplifies (slightLy) the exception handling elsewhere.

17 years agoFix an uncollectable reference leak in bsddb.db.DBShelf.append
Gregory P. Smith [Sat, 13 Oct 2007 23:02:05 +0000 (23:02 +0000)]
Fix an uncollectable reference leak in bsddb.db.DBShelf.append

17 years agoFix email example.
Georg Brandl [Sat, 13 Oct 2007 13:20:03 +0000 (13:20 +0000)]
Fix email example.

17 years agoFixes http://bugs.python.org/issue1233 - bsddb.dbshelve.DBShelf.append
Gregory P. Smith [Fri, 12 Oct 2007 18:44:06 +0000 (18:44 +0000)]
Fixes http://bugs.python.org/issue1233 - bsddb.dbshelve.DBShelf.append
was useless due to inverted logic.  Also adds a test case for RECNO dbs
to test_dbshelve.

17 years agoFix test of count.__repr__() to ignore the 'L' if the count is a long
Raymond Hettinger [Fri, 12 Oct 2007 17:53:11 +0000 (17:53 +0000)]
Fix test of count.__repr__() to ignore the 'L' if the count is a long

17 years agoBug #1216: Restore support for Visual Studio 2002.
Martin v. Löwis [Fri, 12 Oct 2007 08:56:52 +0000 (08:56 +0000)]
Bug #1216: Restore support for Visual Studio 2002.
Will backport to 2.5.

17 years agoGet this module to compile with bsddb versions prior to 4.3
Neal Norwitz [Fri, 12 Oct 2007 03:52:34 +0000 (03:52 +0000)]
Get this module to compile with bsddb versions prior to 4.3

17 years agoFix Coverity 185-186: If the passed in FILE is NULL, uninitialized memory
Neal Norwitz [Fri, 12 Oct 2007 03:05:19 +0000 (03:05 +0000)]
Fix Coverity 185-186:  If the passed in FILE is NULL, uninitialized memory
would be accessed.

Will backport.

17 years agoFix Coverity 180: Don't overallocate. We don't need structs, but pointers.
Neal Norwitz [Fri, 12 Oct 2007 03:04:18 +0000 (03:04 +0000)]
Fix Coverity 180:  Don't overallocate.  We don't need structs, but pointers.
Also fix a memory leak.

17 years agoFix Coverity 168: Close the file before returning (exiting).
Neal Norwitz [Fri, 12 Oct 2007 03:03:23 +0000 (03:03 +0000)]
Fix Coverity 168:  Close the file before returning (exiting).

17 years agoGet rid of compiler warning about retval being used (returned) without
Neal Norwitz [Fri, 12 Oct 2007 03:01:54 +0000 (03:01 +0000)]
Get rid of compiler warning about retval being used (returned) without
being initialized.  (gcc warning and Coverity 202)

17 years agoGet rid of warnings on a bunch of platforms by using a proper prototype.
Neal Norwitz [Fri, 12 Oct 2007 03:01:30 +0000 (03:01 +0000)]
Get rid of warnings on a bunch of platforms by using a proper prototype.

17 years agoGet rid of warning about not being able to create an existing directory.
Neal Norwitz [Fri, 12 Oct 2007 03:01:01 +0000 (03:01 +0000)]
Get rid of warning about not being able to create an existing directory.

17 years agoOn OS X, use os.uname() instead of gestalt.sysv(...) to get the
Thomas Heller [Thu, 11 Oct 2007 19:51:32 +0000 (19:51 +0000)]
On OS X, use os.uname() instead of gestalt.sysv(...) to get the
operating system version.  This allows to use ctypes when Python
was configured with --disable-toolbox-glue.

17 years agoshow paste if > 80 columns. Patch 1659326 Tal Einat.
Kurt B. Kaiser [Wed, 10 Oct 2007 01:06:47 +0000 (01:06 +0000)]
show paste if > 80 columns.  Patch 1659326 Tal Einat.

17 years agoAllow cursor color change w/o restart. Patch 1725576 Tal Einat.
Kurt B. Kaiser [Wed, 10 Oct 2007 00:55:40 +0000 (00:55 +0000)]
Allow cursor color change w/o restart. Patch 1725576 Tal Einat.

17 years agoAccept Jim Jewett's api suggestion to use None instead of -1 to indicate unbounded...
Raymond Hettinger [Wed, 10 Oct 2007 00:26:46 +0000 (00:26 +0000)]
Accept Jim Jewett's api suggestion to use None instead of -1 to indicate unbounded deques.

17 years agoRemove file-level typedefs that were inconsistently used throughout the file.
Brett Cannon [Wed, 10 Oct 2007 00:07:50 +0000 (00:07 +0000)]
Remove file-level typedefs that were inconsistently used throughout the file.
Just move over to the public API names.

Closes issue1238.

17 years agoAllow interrupt only when executing user code in subprocess
Kurt B. Kaiser [Tue, 9 Oct 2007 19:31:30 +0000 (19:31 +0000)]
Allow interrupt only when executing user code in subprocess
Patch 1225 Tal Einat modified from IDLE-Spoon.

17 years agoremove another sleepycat reference
Gregory P. Smith [Tue, 9 Oct 2007 18:26:02 +0000 (18:26 +0000)]
remove another sleepycat reference

17 years agoUse the highest cPickle protocol in bsddb.dbshelve. This comes from
Gregory P. Smith [Tue, 9 Oct 2007 07:19:11 +0000 (07:19 +0000)]
Use the highest cPickle protocol in bsddb.dbshelve.  This comes from
sourceforge pybsddb patch 1551443 by w_barnes.

17 years agoFix a double free when positioning a database cursor to a non-existant
Gregory P. Smith [Tue, 9 Oct 2007 06:50:43 +0000 (06:50 +0000)]
Fix a double free when positioning a database cursor to a non-existant
string key (and probably a few other situations with string keys).
This was reported with a patch as pybsddb sourceforge bug 1708868 by
jjjhhhlll at gmail.

17 years agoSplits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
Gregory P. Smith [Tue, 9 Oct 2007 06:02:21 +0000 (06:02 +0000)]
Splits Modules/_bsddb.c up into bsddb.h and _bsddb.c and adds a C API
object available as bsddb.db.api.  This is based on the patch submitted
by Duncan Grisby here:
  http://sourceforge.net/tracker/index.php?func=detail&aid=1551895&group_id=13900&atid=313900
See this thread for additional info:
  http://sourceforge.net/mailarchive/forum.php?thread_name=E1GAVDK-0002rk-Iw%40apasphere.com&forum_name=pybsddb-users

It also cleans up the code a little by removing some ifdef/endifs for
python prior to 2.1 and for unsupported Berkeley DB <= 3.2.