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

2018-03-11 Thread Berker Peksag

Change by Berker Peksag :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-11 Thread Matej Cepl

Matej Cepl  added the comment:

OK, Serhiy you have the point: it was just a good exercise for me, but the 
benefit is doubtful. Could somebody close this ticket then?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-11 Thread Berker Peksag

Berker Peksag  added the comment:

I agree with Serhiy and Terry. Also, PR 5999 does not accept pathlib.Path() 
objects at the moment. This and Serhiy's following comment are good examples of 
why it shouldn't be added to the standard library in my opinion:

> 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().

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-11 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-11 Thread Terry J. Reedy

Terry J. Reedy  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-11 Thread Serhiy Storchaka

Serhiy Storchaka  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-11 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-05 Thread Roundup Robot

Change by Roundup Robot :


--
keywords: +patch
pull_requests: +5765
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-05 Thread bbayles

Change by bbayles :


--
nosy: +bbayles

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2018-03-05 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-11-25 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: Feature request: ConfigParser should be able to write config to a given 
filename, not only into file object -> ConfigParser should be able to write 
config to a given filename, not only into file object

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com