#43 python.cxx problems

closed-works-for-me
python (259)
5
2001-12-06
2001-07-08
No

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.

Discussion

  • Carl Staelin

    Carl Staelin - 2001-07-08

    diffs to Source/Modules1.1/python.cxx

     
  • David M. Beazley

    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.

     
  • David M. Beazley

    • assigned_to: nobody --> beazley
    • status: open --> open-works-for-me
     
  • Leland Wang

    Leland Wang - 2001-10-20

    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.

     
  • David M. Beazley

    • status: open-works-for-me --> closed-works-for-me
     
  • David M. Beazley

    Logged In: YES
    user_id=7557

    1) Fixed in 1.3.10.
    2) Not reproducible. Need more information.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks