GNOME Bugzilla – Bug 703897
Functions which can return null always return a Python object
Last modified: 2018-06-29 23:17:17 UTC
Certain Gucash internal functions are capable of returning null under certain circumstances e.g. xaccSplitGetOtherSplit normally returns a split, but if the split passed in is part of a transaction with multiple splits it will return null instead. The Python helper functions currently don’t support this behaviour and will always return the type of object set for them to return in gnucash_core.py e.g. the Split class has a function GetOtherSplit defined as returning a Split. If there is no other split, a Split object is returned rather than None, and attempting to use this object can cause segfaults. I have produced a small patch which alters the Python bindings to check if the object in question is actually none, and resolve this issue, but I am unfamiliar with this part of the Python bindings so would value input from anyone else with more experience in this area. Kind regards, Tom
Created attachment 248767 [details] [review] Patch to resolve bug
Comment on attachment 248767 [details] [review] Patch to resolve bug Committed to trunk: r23116. Thanks.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=703897. Please update any external references or bookmarks.