Correct handling of boolean selections
authorJeremy Stanley <fungi@yuggoth.org>
Wed, 10 Nov 2021 18:38:34 +0000 (18:38 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Wed, 10 Nov 2021 18:59:18 +0000 (18:59 +0000)
The selections proxy class, which mashes together command-line
arguments and configuration options, contained a longstanding and
fatal flaw with its handling of boolean values. In particular,
falsey values were consistently treated as truthy due to naively
recasting str to bool (which will always yield True unless empty).
This went unnoticed for so long because the majority of these
settings default to False, meaning the only reason most users had to
set them was to override them to True.

Many thanks to Jordan Russell for bringing this bug to my attention,
and for supplying an initial patch on which this fix is heavily
based.

Co-Authored-By: Jordan Russell

No differences found