Title: ConfigParser.set() docs should mention allow_no_value
Type: enhancement Stage: patch review
Components: Documentation Versions: Python 3.9, Python 3.8, Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, nanjekyejoannah, ncoghlan
Priority: normal Keywords: patch

Created on 2019-06-28 09:23 by ncoghlan, last changed 2019-08-07 12:56 by nanjekyejoannah.

Pull Requests
URL Status Linked Edit
PR 14455 closed Kriyszig, 2019-06-28 17:59
Messages (1)
msg346813 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2019-06-28 09:23
Reviewing some code today, I came across a ConfigParser.set() call that only specified the section and key, with the value argument missing.

If you look at the ConfigParser.set() docs, this seems like incorrect code, as those docs indicate that the value argument is a required parameter:

However, checking the code shows that:

1. "value" has a default value of None
2. if "allow_no_value" is passed to the constructor, passing "None" as the value will be interpreted as a request to add a key-only entry to the section with no equals sign
Date User Action Args
2019-08-07 12:56:36nanjekyejoannahsetnosy: + nanjekyejoannah
2019-06-28 17:59:26Kriyszigsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request14272
2019-06-28 09:23:20ncoghlancreate