toml
toml copied to clipboard
TomlDecodeError: Loading with multiple dictionaries within a dictionary.
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}}}}
Similar example with problems:
bad = {x = [[1, 1], [1, 2]]}
good = {x = [[1, 1]]}
good = {x = [1, 2]}