Skip to content

Commit

Permalink
Bug 799308 - sqlite backend: Example Python script prints error...
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jralls committed Sep 5, 2024
1 parent 0d6303e commit 02e2fa0
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions bindings/python/gnucash_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 02e2fa0

Please sign in to comment.