pyhocon icon indicating copy to clipboard operation
pyhocon copied to clipboard

Conversion results (JSON, HOCON, ...) do not end with a new line

Open sbachstein opened this issue 4 years ago • 0 comments

Version 0.3.58

This affects all available converters. I use JSON here as an example:

import pyhocon
config = pyhocon.ConfigTree()
config.put('foo', 'bar')
pyhocon.HOCONConverter.convert(config, 'json')

Result: '{\n "foo": "bar"\n}'

Expected: '{\n "foo": "bar"\n}\n'

The new line character is desirable for a number of reasons, one of them it being the POSIX standard. For a larger discussion, see, for example, this thread: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

sbachstein avatar Sep 13 '21 08:09 sbachstein