Skip to content

Handle malformed unknown fields cleanly - #160

Open
Bolt4243 wants to merge 1 commit into
dtcooper:masterfrom
Bolt4243:fix/unknown-field-warning
Open

Bolt4243 wants to merge 1 commit into
dtcooper:masterfrom
Bolt4243:fix/unknown-field-warning

Conversation

@Bolt4243

Copy link
Copy Markdown

An unknown field with a size incompatible with its declared base type reaches the byte fallback, but building the warning first accesses field.name when no profile field exists. That raises AttributeError instead of following the intended warning path.

Use the field definition number in warnings for unknown fields, then continue with the existing byte fallback. The regression test parses the malformed definition and verifies the warning.

Tests: full unittest suite, workflow flake8 checks, and coverage run with 93% total coverage.

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.

2 participants