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.
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 = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "DB", /*tp_name*/ sizeof(DBObject), /*tp_basicsize*/ ... to: 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) { ... to: PyMODINIT_FUNC init_bsddb(void) { ... - Remove Py_TPFLAGS_HAVE_WEAKREFS. - 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. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:34 | admin | set | github: 47136 |
| 2008年09月16日 18:19:57 | jcea | set | status: open -> closed resolution: rejected messages: + msg73306 |
| 2008年07月09日 01:47:38 | trent | set | nosy:
+ trent messages: + msg69449 |
| 2008年05月29日 11:47:32 | jcea | set | messages:
+ 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:12 | gregory.p.smith | set | assignee: jcea messages: + msg67320 |
| 2008年05月16日 05:27:41 | alexandre.vassalotti | create | |