We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, nice work here. Thank you for the project.
I have a bug report to file.
x = tomlkit.parse(''' [root1.root2] value = 1 [root1.root2.a.b.c] value = 2 [WALRUS] goo = "gjob" [root1.root2.x] value = 4 ''') x['root1']['root2']['a'].add('tmp', 'hi') print(tomlkit.dumps(x))
Expected (amongst other formatting possibilities):
[root1.root2] value = 1 [root1.root2.a] tmp = "hi" [root1.root2.a.b.c] value = 2 [WALRUS] goo = "gjob" [root1.root2.x] value = 4
But the code rather prints:
[root1.root2] value = 1 [root1.root2.a] [root1.root2.a.b.c] value = 2 tmp = "hi" [WALRUS] goo = "gjob" [root1.root2.x] value = 4
This TOML code places tmp = "hi" under a.b.c, not a (as the Python code said).
tmp = "hi"
a.b.c
a
Another instance of the bug is:
x = tomlkit.parse(''' [root1.root2.a.b.c] value = 2 [WALRUS] goo = "gjob" [root1.root2.x] value = 4 ''') x['root1']['root2']['a'].add('tmp', 'hi') print(tomlkit.dumps(x))
(NOTE: the code is almost the same. The only difference is that [root1.root2] is gone in the TOML.)
[root1.root2]
In this case, the output does not change with .add(), nor even a direct setitem:
.add()
>>> x['root1']['root2']['a']['tmp'] = 'hi' >>> x['root1']['root2']['a'] {'b': {'c': {'value': 2}}}
Maybe the update is happening on some kind of proxy object, which interacts badly with the original object, I don't know.
Maybe there's a bug in parsing out-of-order sections, cc. #196 #261?
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Hi, nice work here. Thank you for the project.
I have a bug report to file.
Expected (amongst other formatting possibilities):
But the code rather prints:
This TOML code places
tmp = "hi"
undera.b.c
, nota
(as the Python code said).Another instance of the bug is:
(NOTE: the code is almost the same. The only difference is that
[root1.root2]
is gone in the TOML.)In this case, the output does not change with
.add()
, nor even a direct setitem:Maybe the update is happening on some kind of proxy object, which interacts badly with the original object, I don't know.
Maybe there's a bug in parsing out-of-order sections, cc. #196 #261?
The text was updated successfully, but these errors were encountered: