When creating a pipeline using pipenv, I ran into a weird situation where the Pipfile would get corrupted in certain cases, when there would be multiple entries in an array of tables and the last one was at the end of the file AND that does not have a final newline at the end
The following python code reproduces the problem with tomlkit 0.13.2
import tomlkit
toml_str = '''[[products]]
name = "Hammer"
[foo]
[bar]
[[products]]
name = "Nail"'''
parsed = tomlkit.loads(toml_str)
print(tomlkit.dumps(parsed))
Running this python code will give the following (wrong) output:
[[products]]
name = "Hammer"
[[products]]
name = "Nail"[foo]
[bar]
As you can see, the foo table entry is put directly after the last entry of products
If you add a trailing newline at the end of the file, this problem does not occur.
When creating a pipeline using pipenv, I ran into a weird situation where the Pipfile would get corrupted in certain cases, when there would be multiple entries in an array of tables and the last one was at the end of the file AND that does not have a final newline at the end
The following python code reproduces the problem with tomlkit 0.13.2
Running this python code will give the following (wrong) output:
As you can see, the
foo
table entry is put directly after the last entry of productsIf you add a trailing newline at the end of the file, this problem does not occur.