Boost logo

Boost Users :

Subject: [Boost-users] Boost.Python to-Python converter for class T already registered
From: Tyler Weston (tyler.weston_at_[hidden])
Date: 2011-06-27 14:35:38


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<class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >,class std::allocator<class basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > > > already registered;
second conversion method ignored.

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)?



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net