Subject: [Boost-bugs] [Boost C++ Libraries] #3653: converter collisions behave differently debug|release
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-11-20 21:02:41
#3653: converter collisions behave differently debug|release
--------------------------+-------------------------------------------------
Reporter: troy | Owner: dave
Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: Python
Version: Boost 1.41.0 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
from a thread on the c++-sig list titled "dynamic compile and to-Python
converter..."
The 'worst' and most common scenario is, precisely put: more than one
python extension module over which we have no control has wrapped type T.
We need to use them simultaneously. For instance, here are two modules
that both wrap vector<double>. With assertions enabled, this happens:
>>> import converter_collisions1_ext
>>> import converter_collisions2_ext
python:
/home/troy/Projects/boost/src/libs/python/src/converter/registry.cpp:212:
void boost::python::converter::registry::insert(PyObject* (*)(const
void*), boost::python::type_info, const PyTypeObject* (*)()): Assertion
`slot->m_to_python == 0' failed.
zsh: abort python
delightfully, without assertions there is only a warning:
>>> import converter_collisions1_ext
>>> import converter_collisions2_ext
__main__:1: RuntimeWarning: to-Python converter for std::vector<double,
std::allocator<double> > already registered; second conversion method
ignored.
So one resolution is to remove the 'assert' that triggers this crash and
leave the semantics as-is: second and later converter registrations are
warned about and ignored. I'm simply suggesting we give the user more
control over this behavior, because in a number of situations (it is up to
the user to determine what they are) such control would be useful.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3653> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC