gnucash stable: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Fri Sep 25 19:12:43 EDT 2026
Updated via https://github.com/Gnucash/gnucash/commit/3cf1352c (commit)
via https://github.com/Gnucash/gnucash/commit/0dc41c12 (commit)
from https://github.com/Gnucash/gnucash/commit/fbcb9f5e (commit)
commit 3cf1352cbb2aa8405bbd6df38c047bf3cee9f938
Merge: fbcb9f5e75 0dc41c1212
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Sep 25 16:10:42 2026 -0700
Merge Noah Noerr's 'python-guard-price-set-source-string' into stable.
commit 0dc41c1212028c163c3717235c182fe34d08ed4c
Author: Noerr <Noerr at users.noreply.github.com>
Date: Wed Sep 23 02:06:17 2026 -0700
[bindings/python] Deprecate set_source_string; remove it from the Guile bindings
gnc_price_set_source_string maps a source string to the PriceSource enum and
silently leaves the source unchanged for anything it doesn't recognize -- a
silent no-op a naive Python or Guile script can hit. Steer callers to
set_source() with a PriceSource member (added in #2317) instead.
Python bindings:
- Deprecate GncPrice.set_source_string(): it now emits a DeprecationWarning
pointing at set_source(PriceSource.<...>). It still works during the
deprecation period and still guards -- if the string is not recognized (the
round-tripped source no longer equals the input) it raises ValueError rather
than silently doing nothing.
- Fix the deprecated() decorator in deprecation.py: it referenced the undefined
DeprecationWarnig and inspect.current_frame(), so it raised instead of
warning (the one existing @deprecated use was latently broken).
Guile bindings:
- mark gnc-price-set-source-string deprecated in engine.i.
(Python and Guile use separate SWIG interface files, so Python is
handled separately). The only in-tree Guile caller is the QIF importer, updated to
gnc-price-set-source with PRICE-SOURCE-USER-PRICE; the redundant
set-source-string in test-engine-extras.scm's fixture helper is dropped.
Tests (test_price_and_wrapping.py):
- TestSetSourceStringGuard covers the guard (still raises on an unrecognized
string) and the new DeprecationWarning.
Removing set_source_string from the Python bindings is a follow-up.
Summary of changes:
bindings/engine.i | 9 +++++
bindings/guile/test/test-engine-extras.scm | 1 -
bindings/python/deprecation.py | 6 +--
bindings/python/gnucash_core.py | 33 ++++++++++++++---
bindings/python/tests/test_price_and_wrapping.py | 47 ++++++++++++++++++++++++
gnucash/import-export/qif-imp/qif-to-gnc.scm | 2 +-
6 files changed, 87 insertions(+), 11 deletions(-)
More information about the gnucash-patches
mailing list