Hi,
I've encountered an invalid TOML document after modifying and inserting an InlineTable.
Here's an example -- the resulting document is invalid since it declares the [foo] table twice:
>>> from tomlkit import parse, inline_table
>>> doc = parse("""[foo.bar]
... here = true
...
... [foo]
... a = 1
... b = 2
... """)
>>> doc["foo"]["bar"] = inline_table()
>>> doc["foo"]["bar"].update({"a": "b"})
>>> print(doc.as_string())
[foo]
bar = {a = "b"}
[foo]
a = 1
b = 2
>>> parse(doc.as_string())
tomlkit.exceptions.ParseError: Key "foo" already exists. at line 5 col 0
This behavior doesn't happen with normal non-inline tables and can also be worked around by round-tripping to JSON since the dotted table syntax is a prerequisite for this issue.
Hi,
I've encountered an invalid TOML document after modifying and inserting an
InlineTable.Here's an example -- the resulting document is invalid since it declares the
[foo]table twice:This behavior doesn't happen with normal non-inline tables and can also be worked around by round-tripping to JSON since the dotted table syntax is a prerequisite for this issue.