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

Parser rejects out-of-order array of tables #261

Open
ghost opened this issue Jan 24, 2023 · 0 comments
Open

Parser rejects out-of-order array of tables #261

ghost opened this issue Jan 24, 2023 · 0 comments
Labels
bug Something isn't working spec

Comments

@ghost
Copy link

ghost commented Jan 24, 2023

The tomlkit parser rejects the following document:

[[fruit]]  # the issue disappears if [fruit] is a table instead of a table array
apple.color = "red"

[potato]  # the issue disappears if this line is removed

[fruit.apple.texture]
smooth = true

and raises:

tomlkit.exceptions.ParseError: Key "fruit" already exists. at line 7 col 0

It seems clear to me that the document is valid TOML 1.0.0. In any case the presence of the [potato] table should not make a difference wrt its validity.

This issue applies to the latest commit 6512eaa on master as well as the latest release v0.11.6.

I'm experimenting with a TOML fuzzer which revealed this issue. I guess most normal applications are not likely to hit this case, so I understand if this gets low priority. It still seems worthwhile to fix it though.

@frostming frostming added bug Something isn't working spec labels Apr 27, 2023
@frostming frostming changed the title Parser sometimes rejects subtable of table array Parser rejects out-of-order array of tables Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working spec
Projects
None yet
Development

No branches or pull requests

1 participant