[New-bugs-announce] [issue39306] Lib/configparser.py - RawConfigParser.set does not pass non-truthy values through to Interpolation.before_set

Hans Strijker report at bugs.python.org
Sat Jan 11 14:41:48 EST 2020


New submission from Hans Strijker <hans at stry.org>:

Method ```configparser.RawConfigParser.set()``` has optional parameter *value* with default value ```None``` resulting in the behavior that actually trying to set a config parameter to ```None``` will not be propagated to ```Interpolation.before_set()```. In fact, since it uses ```if value:``` and not ```if value is None:``` none of the non-truthy values will be passed through.

Suggested commit [8e008be](https://github.com/HStry/cpython/commit/8e008bea0cf6bd3c698b333fd39a383e124fe026) using already established ```_UNSET``` singleton, but that appears to break compatibility elsewhere.

----------
components: Library (Lib)
messages: 359820
nosy: Strijker, taleinat
priority: normal
pull_requests: 17362
severity: normal
status: open
title: Lib/configparser.py - RawConfigParser.set does not pass non-truthy values through to Interpolation.before_set
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39306>
_______________________________________


More information about the New-bugs-announce mailing list