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

remove last element of an Inline Table leaves a comma #259

Closed
gregT9 opened this issue Jan 23, 2023 · 0 comments · Fixed by #267
Closed

remove last element of an Inline Table leaves a comma #259

gregT9 opened this issue Jan 23, 2023 · 0 comments · Fixed by #267

Comments

@gregT9
Copy link

gregT9 commented Jan 23, 2023

removing the last element of an Inline Table leaves a comma
this fail :

import tomlkit

to_parse='entry = {  version = "11.0", registry = "reg", path="/tmp/foo" }'
data = tomlkit.parse(to_parse)
data["entry"].remove("path")
assert data["entry"].as_string() == 'entry = {  version = "11.0", registry = "reg" }'

because data["entry"].as_string() is
{ version = "11.0", registry = "reg", }

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.

1 participant