There are two problems in python.cxx, that I think
I have fixed (patch relative to 1.3a5 attached):
1) typemap(python,freearg) would generate incorrect
code, so you would free()/delete the PyObject
instead of the native C/C++ object $target
created in the previous typemap(python, in) code.
(instead the original code deletes $source!)
2) there is a problem with the generated shadow
classes that setting "self.this" in the __init__
function causes python 2.0 and 2.1 to choke.
(For some reason python dies in __setattr__ when
checking if (name == "this") or (name == "thisown):
I changed the generated python code to use the
uglier self.__dict__["this"] form and the problem
went away.
diffs to Source/Modules1.1/python.cxx
Logged In: YES
user_id=7557
I'm not sure the typemap(python,freearg) behavior is a bug.
The
code looks the same as for SWIG1.1p5. $source is the object
to
be freed. $target is the original PyObject *. See p. 22 of
the
SWIG Reference Manual.
I have no idea on the setattr() problem. How does Python
die? Need more specifics.
Logged In: YES
user_id=250815
After looking into Mr. Staelin's code and reading the
reference, problem 1 seems to be a mistake. There is nothing
wrong with swig. I tried Mr. Staelin's code on swig 1.3.6,
and it ran smoothly without the crash.
Logged In: YES
user_id=7557
1) Fixed in 1.3.10.
2) Not reproducible. Need more information.