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

Serhiy Storchaka report at bugs.python.org
Sun Mar 11 09:14:01 EDT 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

What is a problem with writing two lines of code?

    with open(...) as f:
        config.write(f)

If combine ConfigParser.write() with builtin open() you will need to add support of encoding, errors, buffering, newline, and other arguments supported by open(). And don't forgot to update this method after adding new parameters to open().

I'm -1. Not every two lines of code deserve including as a function in the stdlib. This will clutter the user interface, complicate the implementation, and add the burden to core developers for maintaining this code.

----------
nosy: +serhiy.storchaka

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


More information about the Python-bugs-list mailing list