Partially answering my own question. It doesn't look like the GncOwner out typemap is quite right.
The return should be an object of type Customer, Job, Employee or Vendor as suggested by the decorate at gnucash_business.py:176. I wrote a function in my script based on that decorate that converted the return from GetOwner to one of the above. That solved my problem. Now, GetAddr works and I can access the addresses. I'm not sure how to change the typemap or what else would have to be changed as a consequence. But, I hope the above is helpful to that end. Steve On Sun, 2023-01-29 at 08:38 -0500, Steve Brown wrote: > I get a Python GncOwner object returned to Python. It appears well > formed. > > owner: <class 'gnucash.gnucash_core.GncOwner'> > <gnucash.gnucash_core.GncOwner object at 0x7f33d4cc3050> > owner_instance: <class 'tuple'> (4, <Swig Object of type 'GncVendor > *' at 0x7f214b5a9500>) > > It's not clear how to easily inspect the Swig object. > > However, the object doesn't convert back to C. It's not recognized as > GncVendor. > > I get: > > ValueError: Python object passed to function with GncOwner * argument > couldn't be converted back to pointer of that type > > The out typemap for GncOwner looks correct. However, I can't see how > the in typemap gets the swig wrapper object from the tuple created by > the out typemap. > > I can recreate the problem in simple_business_create.py with the > attached patch. > > If there is nothing obviously wrong with the typemaps, how should I > go > about debugging this? > > Thanks, > Steve > _______________________________________________ > gnucash-devel mailing list > gnucash-devel@gnucash.org > https://lists.gnucash.org/mailman/listinfo/gnucash-devel _______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel