[issue32917] ConfigParser writes a superfluous final blank line

2021-12-09 Thread Irit Katriel
Change by Irit Katriel : -- stage: patch review -> resolved status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there is no real problem, I think it is not worth to change this. -- resolution: -> rejected status: open -> pending ___ Python tracker

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-10 Thread TitanSnow
TitanSnow added the comment: For the case of sequential writes to the same file, I think it’s a invalid use case. The file can be created or modified by user or other applications, breaking the assume of ConfigParser. It’s better to have a method to merge two ConfigParser

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-10 Thread TitanSnow
TitanSnow added the comment: > But I didn't thought that a superfluous final blank line causes any problems. > What software has a problem with it? Currently I have not found a program that has problem with the superfluous final blank line, and I think there won’t be. >

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I thought a blank line between sections is just for readability, and no program will break if drop it. Removing the final blank line can harm the readability in the case of sequential writes to the same file (unless we detect

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Mar 10, 2018 at 06:37:28AM +, TitanSnow wrote: > > TitanSnow added the comment: > > If we treat the original behavior as a bug, > it’s much easier to write a patch > that just changes the default

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-09 Thread TitanSnow
TitanSnow added the comment: If we treat the original behavior as a bug, it’s much easier to write a patch that just changes the default behavior and never outputs a final blank line. I have looked through the testsuite of it. It seems that the original author had knew

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-09 Thread TitanSnow
TitanSnow added the comment: I’m afraid of breaking the backward compatibility. -- ___ Python tracker ___

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Adding two new parameters to control so tiny detail of the output looks excessive to me. What if just change the default behavior and never output a final blank line? -- nosy: +lukasz.langa, serhiy.storchaka

[issue32917] ConfigParser writes a superfluous final blank line

2018-03-05 Thread Matej Cepl
Change by Matej Cepl : -- nosy: +mcepl ___ Python tracker ___ ___ Python-bugs-list mailing

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-23 Thread TitanSnow
Change by TitanSnow : Removed file: https://bugs.python.org/file47461/bpo-32917.patch ___ Python tracker ___

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-23 Thread TitanSnow
Change by TitanSnow : -- pull_requests: +5621 stage: -> patch review ___ Python tracker ___

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-23 Thread TitanSnow
Change by TitanSnow : Removed file: https://bugs.python.org/file47460/final_blank_line.patch ___ Python tracker ___

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-23 Thread TitanSnow
TitanSnow added the comment: Patch updated, included documentation and tests. -- Added file: https://bugs.python.org/file47461/bpo-32917.patch ___ Python tracker

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread TitanSnow
TitanSnow added the comment: **It's not final newline \n !** Maybe what I said confused. The "final blank line" does not mean the "final newline char". It means an extra blank line after last line. It might be clearer to represent it in a string:: '[section1]\nkey =

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Oh, I forgot... even if it is decided that this trim_final_blankline parameter was desirable, the patch isn't sufficient to be accepted. You would need to also supply documentation and tests. --

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Its not a superfluous blank line. It is standard convention for Unix tools to end text files (of which ini files are a kind of text file) with a final newline \n. There are various reasons for this, but it doesn't matter what

[issue32917] ConfigParser writes a superfluous final blank line

2018-02-22 Thread TitanSnow
New submission from TitanSnow : ``ConfigParser.write()`` writes a superfluous final blank line. Example:: import configparser cp = configparser.ConfigParser() cp['section1'] = {'key': 'value'} cp['section2'] = {'key': 'value'} with