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

Unable to parse array of mixed types (string + array) - IndexError: list index out of range: #444

Open
nekromoff opened this issue Jul 8, 2024 · 2 comments

Comments

@nekromoff
Copy link

See: toml-lang/toml#1033

python report.py
Traceback (most recent call last):
File "report.py", line 10, in <module>
config=toml.load("config.toml")
File "/home/xxx/.local/lib/python3.10/site-packages/toml/decoder.py", line 134, in load
return loads(ffile.read(), _dict, decoder)
File "/home/xxx/.local/lib/python3.10/site-packages/toml/decoder.py", line 511, in loads
ret = decoder.load_line(line, currentlevel, multikey,
File "/home/xxx/.local/lib/python3.10/site-packages/toml/decoder.py", line 778, in load_line
value, vtype = self.load_value(pair[1], strictly_valid)
File "/home/xxx/.local/lib/python3.10/site-packages/toml/decoder.py", line 880, in load_value
return (self.load_array(v), "array")
File "/home/xxx/.local/lib/python3.10/site-packages/toml/decoder.py", line 1002, in load_array
a[b] = a[b] + ',' + a[b + 1]
IndexError: list index out of range

TOML line that crashes the parser:

ping = ["/usr/bin/ping -c4 8.8.8.8", ["packets", "rtt"] ]
@nekromoff
Copy link
Author

Probably duplicate of #270

@nekromoff
Copy link
Author

nekromoff commented Jul 8, 2024

I found https://github.com/hukkin/tomli that does not have this issue, if somebody stumbles on this error.

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

No branches or pull requests

1 participant