This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: bsddb3 needs to be ported to Python 3.0
Type: enhancement Stage:
Components: Extension Modules, Library (Lib), Tests Versions: Python 3.0
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: jcea Nosy List: alexandre.vassalotti, gregory.p.smith, jcea, trent
Priority: normal Keywords:

Created on 2008-05-16 05:27 by alexandre.vassalotti, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg66918 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2008-05-16 05:27
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.
msg67320 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2008-05-25 06:11
I believe Jesus wants to do this is such a way that bsddb.h and _bsddb.c
are a single code base with #ifdef's that compiles on 2.x and 3.x at once.
msg67487 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2008-05-29 11:47
Yes. My idea is to port the python code as-is, using "2to3", and update
the C code with conditional compilation, to keep a single codebase.

I'm having issues with the compatibility. In particular, my code has the
following line:

staticforward PyTypeObject DB_Type, DBCursor_Type, DBEnv_Type,
DBTxn_Type, DBLock_Type;

Compiling this code fails with the following error (when compiling
against Python 3.0):

Modules/_bsddb.c:241: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'PyTypeObject'

Compiling the same code against Python 2.x, works.

Ideas welcomed :).
msg69449 - (view) Author: Trent Nelson (trent) * (Python committer) Date: 2008-07-09 01:47
FWIW, I bumped the version of Berkeley DB being used on Windows from 
4.4.20 to 4.7.25 in r64555 (trunk).  I blocked this from being merged 
to py3k.  This block should be removed once bsddb has been updated.
msg73306 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2008-09-16 18:19
bsddb is officially dropped in Python 3.0. Too bad :(. I close this issue.

bsddb supports Python 3.0 via a separate project, downloadable from PYPI.
Date User Action Args
2022-04-11 14:56:34adminsetgithub: 47136
2008-09-16 18:19:57jceasetstatus: open -> closed
resolution: rejected
messages: + msg73306
2008-07-09 01:47:38trentsetnosy: + trent
messages: + msg69449
2008-05-29 11:47:32jceasetmessages: + msg67487
title: bsddb 4.6.4 needs to be ported to Python 3.0 -> bsddb3 needs to be ported to Python 3.0
2008-05-25 06:11:12gregory.p.smithsetassignee: jcea
messages: + msg67320
2008-05-16 05:27:41alexandre.vassalotticreate