gnucash stable: Bug 799308 - sqlite backend: Example Python script prints error...

John Ralls jralls at code.gnucash.org
Thu Sep 5 15:05:06 EDT 2024


Updated	 via  https://github.com/Gnucash/gnucash/commit/02e2fa0e (commit)
	from  https://github.com/Gnucash/gnucash/commit/0d6303e5 (commit)



commit 02e2fa0eadb7ceddbce54cf702941e961ef9b455
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Sep 5 11:35:52 2024 -0700

    Bug 799308 - sqlite backend: Example Python script prints error...
    
    when creating new file.
    
    Reverts the fix for https://bugs.gnucash.org/show_bug.cgi?id=726891. The
    underlying problem, that a new SQL database needed to be loaded to force
    its creation, is no longer a problem. It was probably corrected as part
    of the C++ rewrite of the SQL backend.

diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py
index 9336c436ae..cddf769c80 100644
--- a/bindings/python/gnucash_core.py
+++ b/bindings/python/gnucash_core.py
@@ -356,15 +356,6 @@ class Session(GnuCashCoreClass):
                 if mode is None:
                     mode = SessionOpenMode.SESSION_NORMAL_OPEN
                 self.begin(book_uri, mode)
-                # Take care of backend inconsistency
-                # New xml file can't be loaded, new sql store
-                # has to be loaded before it can be altered
-                # Any existing store obviously has to be loaded
-                # More background: https://bugs.gnucash.org/show_bug.cgi?id=726891
-                is_new = mode in (SessionOpenMode.SESSION_NEW_STORE, SessionOpenMode.SESSION_NEW_OVERWRITE)
-                scheme = urlparse(book_uri).scheme
-                if not (is_new and scheme == 'xml'):
-                    self.load()
             except GnuCashBackendException as backend_exception:
                 self.end()
                 self.destroy()



Summary of changes:
 bindings/python/gnucash_core.py | 9 ---------
 1 file changed, 9 deletions(-)



More information about the gnucash-changes mailing list