You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tomlkit parser fails on the following valid TOML document:
[[a.b.c]] # note: this line starts with a space character
[a.b]
For example:
>>> import tomlkit
>>> tomlkit.parse(" [[a.b.c]]\n[a.b]")
Traceback (most recent call last):
File "env\Lib\site-packages\tomlkit\parser.py", line 165, in parse
body.append(key, value)
File "env\Lib\site-packages\tomlkit\container.py", line 262, in append
current.append(k, v)
File "env\Lib\site-packages\tomlkit\items.py", line 1600, in append
m = re.match("(?s)^([^ ]*)(.*)$", _item.trivia.indent)
^^^^^^^^^^^^
AttributeError: 'OutOfOrderTableProxy' object has no attribute 'trivia'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "env\Lib\site-packages\tomlkit\api.py", line 83, in parse
return Parser(string).parse()
^^^^^^^^^^^^^^^^^^^^^^
File "env\Lib\site-packages\tomlkit\parser.py", line 167, in parse
raise self.parse_error(ParseError, str(e)) from e
tomlkit.exceptions.ParseError: 'OutOfOrderTableProxy' object has no attribute 't
rivia' at line 2 col 5
The problem disappears if the leading whitespace is removed from the first line.
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.
The text was updated successfully, but these errors were encountered:
The tomlkit parser fails on the following valid TOML document:
For example:
The problem disappears if the leading whitespace is removed from the first line.
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.
The text was updated successfully, but these errors were encountered: