diff --git a/CHANGELOG.md b/CHANGELOG.md index 810d53b..8a67519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Support `|` and `|=` operator for tables, and support `+` and `+=` operator for arrays. ([#331](https://github.com/sdispater/tomlkit/issues/331)) +- Fix an index error when setting dotted keys in a table. ([#332](https://github.com/sdispater/tomlkit/issues/332)) ## [0.12.3] - 2023-11-15 diff --git a/tomlkit/container.py b/tomlkit/container.py index 9251a98..78f0764 100644 --- a/tomlkit/container.py +++ b/tomlkit/container.py @@ -227,9 +227,9 @@ def append( if item.is_super_table(): # We need to merge both super tables if ( - self._table_keys[-1] != current_body_element[0] - or key.is_dotted() + key.is_dotted() or current_body_element[0].is_dotted() + or self._table_keys[-1] != current_body_element[0] ): if key.is_dotted() and not self._parsed: idx = self._get_last_index_before_table()