Skip to content

Fix ForbiddenExtraKeysError formatting when extra keys aren't strings - #784

Open
Pajimo wants to merge 1 commit into
python-attrs:mainfrom
Pajimo:fix/extra-keys-non-str
Open

Pajimo wants to merge 1 commit into
python-attrs:mainfrom
Pajimo:fix/extra-keys-non-str

Conversation

@Pajimo

@Pajimo Pajimo commented Sep 23, 2026

Copy link
Copy Markdown

With forbid_extra_keys, a non-str extra key (e.g. an int key from YAML) makes both str(ForbiddenExtraKeysError) and transform_error blow up with a TypeError since the keys get sorted and joined as is. Converting them to str first, plus a test next to the one from #776.

This branch has not been deployed

No deployments
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