[New-bugs-announce] [issue2887] bsddb 4.6.4 needs to be ported to Python 3.0

Alexandre Vassalotti report at bugs.python.org
Fri May 16 07:27:42 CEST 2008

New submission from Alexandre Vassalotti <alexandre at peadrop.com>:

The recent updates to bsddb (r63207, r63210 and r63218) needs to
forward-ported to the py3k branch.

At first glance, here is the things that needs to be done in the test suite:

  - Change the import:

      from test_all import ...

    into a relative import:

      from .test_all import ...

  - Replace code incompatible with 3.0, such as changing
    ``dict.has_key(key)`` to ``key in dict``.

  - Change str literals to bytes literals where appropriate.

  - Optional: change code like ``type([])`` or ``type(())`` to 
    respectively ``list`` and ``tuple``.

  - Change print statements into print() calls.

  - Change ``x != None`` to ``x is not None``.

In the modules:

  - Change PyInt__* to PyLong_*.
  - Update the PyTypeObject declaration:

       statichere PyTypeObject DB_Type = {
           0,                  /*ob_size*/
           "DB",               /*tp_name*/
           sizeof(DBObject),   /*tp_basicsize*/


       static PyTypeObject DB_Type = {
           PyVarObject_HEAD_INIT(NULL, 0)
           "DB",               /*tp_name*/
           sizeof(DBObject),   /*tp_basicsize*/

  - Update module init declaration:

       DL_EXPORT(void) init_bsddb(void)


      PyMODINIT_FUNC init_bsddb(void)

  - Change PyString_* calls to PyUnicode_* where appropriate.

There probably other things that I missed, but that should give you a
good start.

components: Extension Modules, Library (Lib), Tests
messages: 66918
nosy: alexandre.vassalotti, gregory.p.smith, jcea
priority: normal
severity: normal
status: open
title: bsddb 4.6.4 needs to be ported to Python 3.0
type: feature request
versions: Python 3.0

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list