Skip to content

Reject empty key part lists in key()#566

Closed
santhreal wants to merge 1 commit into
python-poetry:masterfrom
santhreal:upstream/key-empty-iterable
Closed

Reject empty key part lists in key()#566
santhreal wants to merge 1 commit into
python-poetry:masterfrom
santhreal:upstream/key-empty-iterable

Conversation

@santhreal

Copy link
Copy Markdown

tomlkit.key hits DataLoss when key([]) dumps as ' = 1' invalid TOML. This PR fixes the regression with a focused test covering the case.

key([]) built an empty DottedKey that serialized as " = 1", which is
not valid TOML; require at least one key part.
@santhreal santhreal closed this Jul 18, 2026
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

Successfully merging this pull request may close these issues.

1 participant