Skip to content
New issue

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

Indenting error in updating variables #106

Closed
yehonathanJacob opened this issue Sep 1, 2020 · 1 comment · Fixed by #122
Closed

Indenting error in updating variables #106

yehonathanJacob opened this issue Sep 1, 2020 · 1 comment · Fixed by #122

Comments

@yehonathanJacob
Copy link

yehonathanJacob commented Sep 1, 2020

While having this type of file:

[Key1]
      [key1.Key2]
      Value1 = 10
      Value2 = 30

I was trying to do update the Value1, doing so I use the code:

from tomlkit import dumps
from tomlkit.toml_file import TOMLFile

toml_doc = TOMLFile(path_to_file).read()
toml_doc["key1"]["key2"]["Value1"] = 20
dumps(toml_doc)

The resulting file was:

[Key1]
      [key1.Key2]
            Value1 = 20
      Value2 = 30

means, it added double indentation in the updated value

@frostming
Copy link
Contributor

I've created a fork of tomlkit v0.7.0 with the issue fixed, try it:

GitHub: https://github.com/frostming/atoml
PyPI: https://pypi.org/project/atoml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants