Conversion results (JSON, HOCON, ...) do not end with a new line
sbachstein opened this issue · 0 comments
sbachstein commented
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