Python connect to mysql-gnucash doesn't work anymore with Rev 19209

Geert Janssens janssens-geert at telenet.be
Fri May 28 04:31:29 EDT 2010


On Friday 28 May 2010, Christoph Holtermann wrote:
>  Hello !
> 
> My python script ceased to run with a recent version
> of gnucash (19209). It worked with 18542.
> 
> session=Session("mysql://localhost:gnucash:USER:PASSWORD")
> 
> now i get :
> 
> GnuCashBackendException: call to begin resulted in the following errors,
>  (11,)
> 
> Can anyone help ? Did the syntax of the URI change ? I think i got it from
> gnucashs window. Now there it is mysql://christoph@localhost/gnucash.
> Using that in the Sessioncall doesn's help either.
> 
The window title won't display the password. So if you are using a password to 
connect to mysql (most likely), the URI syntax becomes:
mysql://christoph:PASSWORD@localhost/gnucash

I don't know how python connects with gnucash, so I'm not sure how all of this 
propagates.

Assuming python leaves it to GnuCash internals to connect to the database and 
you didn't pass a password via URI, GnuCash will attempt to look up the 
password in the gnome keyring (on linux) or keychain (on OS X). Often 
accessing the key store will also pop up a dialog to unlock it first. If no 
proper password can be found in the key store, it will ask for a password in 
another popup dialog.

You don't give much information about your environment. If there's no X 
environment available, I suppose this keychain unlocking will fail and 
GnuCash' subsequent attempt to ask you for a password as well.


Geert


More information about the gnucash-devel mailing list