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.

Author jcea
Recipients dmalcolm, flox, jcea
Date 2010-11-05.00:16:04
SpamBayes Score 5.7598903e-08
Marked as misclassified No
Message-id <1288916166.59.0.557225304287.issue9675@psf.upfronthosting.co.za>
In-reply-to
Content
Better bsddb error control. Please, review.

"""
[jcea@babylon5 release27-maint]$ ./python
Python 2.7.0+ (release27-maint:86176:86178M, Nov  5 2010, 00:30:) 
[GCC 4.5.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import bsddb
>>> exit()
"""

"""
[jcea@babylon5 release27-maint]$ ./python -3
Python 2.7.0+ (release27-maint:86176:86178M, Nov  5 2010, 00:30:) 
[GCC 4.5.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import bsddb
__main__:1: DeprecationWarning: in 3.x, the bsddb module has been removed; please use the pybsddb project instead
/home/python/svn-hg/release27-maint/Lib/bsddb/__init__.py:67: DeprecationWarning: CObject type is not supported in 3.x. Please use capsule objects instead.
  import _bsddb
"""

"""
[jcea@babylon5 release27-maint]$ ./python -3 -Werror
Python 2.7.0+ (release27-maint:86176:86178M, Nov  5 2010, 00:30:)
[GCC 4.5.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> warnings.filterwarnings('ignore',
... "in 3.x, the bsddb module has been removed; please use the pybsddb project instead",
... category=DeprecationWarning)
>>> import bsddb
Exception DeprecationWarning: DeprecationWarning('CObject type is not supported in 3.x. Please use capsule objects instead.',) in <module '_bsddb' (built-in)> ignored
>>> exit()
"""

Why is my "PyErr_Warn()" not being printed?

The code: (py_api is the CObject, will be NULL if an exception happened)

"""
    if (py_api) {
        PyDict_SetItemString(d, "api", py_api);
        Py_DECREF(py_api);
    } else { /* Something bad happened */
        PyErr_WriteUnraisable(m);
        PyErr_Warn(PyExc_RuntimeWarning,
                "_bsddb/_pybsddb C API will be not available");
        PyErr_Clear();
    }
"""

Commit r86180.

Now I have to up-port this patch to the upcoming pybssddb 5.1.1.
History
Date User Action Args
2010-11-05 00:16:06jceasetrecipients: + jcea, flox, dmalcolm
2010-11-05 00:16:06jceasetmessageid: <1288916166.59.0.557225304287.issue9675@psf.upfronthosting.co.za>
2010-11-05 00:16:05jcealinkissue9675 messages
2010-11-05 00:16:04jceacreate