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
{{ message }}
Repository navigation
"IndexError: list index out of range" when using dotkeys and non-dotkeys #273
I expect to be able to output something like this (using t.as_string()):
foo = 2bar.baz = 1bar.qux = 1
Instead, I get this exception:
Traceback (most recent call last):
File "/tmp/script.py", line 6, in <module>
t.add(tomlkit.key(["bar", "qux"]), 1)
File "/usr/lib/python3/dist-packages/tomlkit/items.py", line 1478, in add
return self.append(key, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/tomlkit/items.py", line 1584, in append
self._value.append(key, _item)
File "/usr/lib/python3/dist-packages/tomlkit/container.py", line 188, in append
self._handle_dotted_key(key, item)
File "/usr/lib/python3/dist-packages/tomlkit/container.py", line 150, in _handle_dotted_key
self.append(name, value)
File "/usr/lib/python3/dist-packages/tomlkit/container.py", line 243, in append
self._table_keys[-1] != current_body_element[0]
~~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range
Activity
fix: Add failing tests for python-poetry#273 (TDD)
frostming commentedon Apr 27, 2023
This should be fixed by #284