Re: [PATCH 3/3] WIP: print error message from glib ini parser

2023-09-13 Thread Eric Blake
> _string); > + if (status_string) { > + fputs (status_string, stderr); > + free (status_string); > + status_string = NULL; > + } > + > switch (status) { > case NOTMUCH_STATUS_NO_CONFIG: >

Re: [PATCH 2/3] CLI: exit with error when load_config returns and error.

2023-09-13 Thread Eric Blake
pect_equal "$output" "false" > > test_begin_subtest "Bad utf8 reported as error" > -test_subtest_known_broken > cp initial-config bad-config > printf '[query]\nq3=from:\xff\n' >>bad-config > test_expect_code 1 "notmuch --config=./bad-config config list"

Re: notmuch breaks on \. in config file with upgrade from glib2 2.76.1 to 2.76.5

2023-09-11 Thread Eric Blake
b2-2.76.1 installed, I'm back to the scenario where 'notmuch --config=.notmuch-config config list' outputs nothing with exit status 0 (when it SHOULD have been reporting glib's error, "Key file contains key ā€œ%sā€ with value ā€œ%sā€ which is not UTF-8"). -- Eric Blake, Principal So

Re: [PATCH] config: Inform user if config file is broken

2023-09-06 Thread Eric Blake
On Wed, Sep 06, 2023 at 12:48:15PM -0300, David Bremner wrote: > Eric Blake writes: > > > > > I'm not sure if this is the best approach (as this is my first ever > > patch to notmuch), but it's better than nothing. > > Unfortunately we can't just print from t

Re: notmuch breaks on \. in config file with upgrade from glib2 2.76.1 to 2.76.5

2023-09-06 Thread Eric Blake
rror message to the user (serves as a warning to a user that their hand-written invalid escapes are being accepted anyways with 2.76.1, and gives the user an explanation why notmuch isn't working with 2.76.5). -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestf

[PATCH] config: Inform user if config file is broken

2023-09-06 Thread Eric Blake
glib 2.76.1 silently treats invalid escape sequences as two characters, even though it is willing to set a GError warning about it. While 'notmuch config set' never produces such sequences in the config file, the fact that the config file is human-readable lends itself to hand-written edits,

[PATCH] .gitignore: ignore __pycache__

2023-09-06 Thread Eric Blake
Python likes to leave behind cache files; noticeable when doing an in-tree build. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f94d1480..eda6d9cf 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@

notmuch breaks on \. in config file with upgrade from glib2 2.76.1 to 2.76.5

2023-09-06 Thread Eric Blake
be the preferred way to modify the config file - but since it IS a human-readable file, notmuch should do a much better job of reporting errors whenever glib's gkeyfile API cannot parse the file (even if that failure to parse is caused by an unintended regression in glib behavior for rejecting somethi