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

TomlDecodeError: Loading with multiple dictionaries within a dictionary. #419

Open
CJP-Whitt opened this issue Mar 31, 2023 · 1 comment
Labels
component: decoder Related to parsing in `toml.load` syntax: inline table Related to inline tables type: bug A confirmed bug or unintended behavior

Comments

@CJP-Whitt
Copy link

Version: v0.10.2
False Error: 'Invalid inline table value encountered'

I get the following error while trying to load the below TOML from a file:
toml.decoder.TomlDecodeError: Invalid inline table value encountered

The contents of the TOML file:
bad = {x = {y = {a = 1}, z = {b = 1}}}

  • This is valid TOML and should parse fine. It will import correctly using tomli load.
  • This error repeats for multiple dictionaries within any dictionary with a depth of 2 or more.

For example, these TOML contents parse fine:

  • good = {x = {a = 1}, y = {b = 1}}
  • good = {x = {y = {a = 1}}}}

And this will fail as well:

  • bad = {x = {y = {w = {a = 1}, z = {b = 1}}}}
@pradyunsg pradyunsg added component: decoder Related to parsing in `toml.load` syntax: inline table Related to inline tables type: bug A confirmed bug or unintended behavior labels Apr 1, 2023
@quimey
Copy link

quimey commented Sep 19, 2023

Similar example with problems:

bad = {x = [[1, 1], [1, 2]]}

good = {x = [[1, 1]]}

good = {x = [1, 2]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: decoder Related to parsing in `toml.load` syntax: inline table Related to inline tables type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants