Boost.Python to-Python converter for class T already registered

Hi All,
I'm integrating a Boost.Python module into a Django project. I'm getting
spammed with warnings for duplicate conversion methods. Django uses a
multi-process model that loads separate copies of the python module into
memory. The module does fine with multiprocess initialization. The warnings
occur when, somehow, Django calls __init__ a second time on my module,
within the same process. The warnings look like:
C:\work\svn\sw\branches\python\imager\__init__.py:1: RuntimeWarning:
to-Python converter for class std::vector

On Monday 27 June 2011 11:35:38 Tyler Weston wrote:
I have a few questions about this, as I am new to python. I thought that modules were supposed to be process-global. How do i enforce this and prevent __init__ from being called twice? Are the warnings benign? Should I be concerned about the state of my library static globals (ie is the compiled code going through a second initialization process)?
In your case, the warnings are benign. However, the fundamental problem of __init__ begin called twice breaks all sorts of expected invariants for python. This should probably be resolved at the level of the code that interfaces with django. Regards, Ravi
participants (2)
-
Ravi
-
Tyler Weston