[issue28788] ConfigParser should be able to write config to a given filename, not only into file object

Terry J. Reedy report at bugs.python.org
Sun Mar 11 09:52:31 EDT 2018


Terry J. Reedy <tjreedy at udel.edu> added the comment:

George, your third sentence is missing a closing ')' somewhere.  In the first part, I believe you meant that the user is able to create a bad file by directly writing other content or calling cf.write more than once.  I don't get the part about duplicated sections.

I was otherwise +-0 about the feature until Serhiy articulated the negatives.  I am now more inclined to close this.

I just reviewed the PR, and the added complications in the test mirror the added complication in the code. With the patch as is, we should document that if a filename is passed, it would be opened with default args other than the mode.

There are other filename or file APIs, but that does not mean that they are without problems.  I suspect that at least some date to times before the addition of with statements.

----------
nosy: +terry.reedy -serhiy.storchaka
versions: +Python 3.8 -Python 3.5

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


More information about the Python-bugs-list mailing list