Python bindings: Account.getName() raises TypeError
David Osguthorpe
david.osguthorpe at gmail.com
Sun Mar 16 19:23:17 EDT 2014
On Sun, Mar 16, 2014 at 11:04:59PM +0100, Felix Schwarz wrote:
> >
> > but then theres another error
>
> Actually your change resolves the problem for me :-)
OK - yes - I think my error came because the existing book I used did not
have any of the default accounts defined
>
> On a second run I get 'ERR_FILEIO_BACKUP_ERROR' because the target backup file
> already exists but that seems to be trivial to work around.
>
> Well, I guess I'll start updating all my scripts with the above change.
>
> However it might be that there is a second bug as the swig definition is
> displayed differently from gnucash's definiton when it comes to "const Account
> *account" vs. 'Account const *'.
>
I dont think swig cares about this - all the info into swig comes from Account.h
but if you look at _wrap_xaccAccountGetName in gnucash_core.c it does indeed call
with (Account const *)
- the error you saw came from a few lines above which is checking the python type
of the incoming argument (SWIG_exception_fail) - which has nothing to do with the
David
More information about the gnucash-devel
mailing list