From 02e2fa0eadb7ceddbce54cf702941e961ef9b455 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 5 Sep 2024 11:35:52 -0700 Subject: [PATCH] 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. --- bindings/python/gnucash_core.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py index 9336c436ae5..cddf769c801 100644 --- a/bindings/python/gnucash_core.py +++ b/bindings/python/gnucash_core.py @@ -356,15 +356,6 @@ def __init__(self, book_uri=None, mode=None, instance=None, book=None): 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()