Message 312615 - Python tracker

Message312615

Author steven.daprano
Recipients steven.daprano, tttnns
Date 2018-02-23.04:50:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519361438.0.0.467229070634.issue32917@psf.upfronthosting.co.za>
In-reply-to
Content
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 those reasons are, the important thing is that it is (or at least, ought to be) intentional for the ini file to end with a \n.

It is not an error for the file to end with one (or more) blank lines, regardless of the platform; it is more convenient for all lines to a \n delimiter, rather than making the last line special.

I do not believe there is any good reason to complicate the code and the API with an unnecessary "trim_final_blankline" parameter, but even if there is a good reason, the default would have to be False to remain backwards compatible.

Unless you have a good reason why it should be considered an error for the INI file to end in a blank, this patch should be rejected, and instead we should have an explicit test to ensure that the INI file is always written with a final blank.

(Of course, when *reading* INI files, it should accept them either with or without final blank.)
History
Date User Action Args
2018-02-23 04:50:38steven.dapranosetrecipients: + steven.daprano, tttnns
2018-02-23 04:50:37steven.dapranosetmessageid: <1519361438.0.0.467229070634.issue32917@psf.upfronthosting.co.za>
2018-02-23 04:50:37steven.dapranolinkissue32917 messages
2018-02-23 04:50:37steven.dapranocreate