Whole file

python-poetry/tomlkit

The author described this change as Fix ParseError when a sub-table extends an array of tables out of order (#498). It counts as a record because the check below fails on the code as it stood at c46482be9 and passes on de68fd06e, with nothing else changed between the two runs.

Fix saved2026-06-23
Sharing licenceMIT · LICENSE
Change size+10 0

What the code was meant to do, written into the code itself as a save note

Fix ParseError when a sub-table extends an array of tables out of order (#498)

The change

260260 return self
261261 elif isinstance(current, AoT):
262262 if not item.is_aot_element():
263+ if item.is_super_table() and len(current.body):
264+ # A sub-table header such as `[fruit.apple.texture]`
265+ # appearing after the array `[[fruit]]` (possibly with
266+ # unrelated tables in between) extends the last element
267+ # of the array, per the TOML spec.
268+ last = current[-1]
269+ for k, v in item.value.body:
270+ last.value.append(k, v)
271+
272+ return self
263273 # Tried to define a table after an AoT with the same name.
264274 raise KeyAlreadyPresent(key)
265275

The check that tells the two apart

failpass·tests/test_toml_document.py::test_subtable_of_aot_element_after_other_table

Check file tests/test_toml_document.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itc46482be9b036c935a193f553c258e4e6e8e3abe
Broken version dated2026-06-23
Moduletomlkit.container
Units changedContainer
Fingerprint3d245fb040fcb648
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in python-poetry/tomlkit