Skip to content

Fix crash when TypedDict contains incorrect metadata #853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JelleZijlstra
Copy link

Fixes at least some of the failures reported in:
#852 (comment)

These were exposed by a bug in 3.14b1 where TypedDict reported
incorrect __annotations__ but correct __required_keys__. msgspec
would crash in this case. The bug is reproducible on earlier Python
versions by manually manipulating attributes on a TypedDict class.

It's a pretty marginal bug but I would argue the extension should
be robust to this sort of edge case.

Fixes at least some of the failures reported in:
jcrist#852 (comment)

These were exposed by a bug in 3.14b1 where TypedDict reported
incorrect `__annotations__` but correct `__required_keys__`. msgspec
would crash in this case. The bug is reproducible on earlier Python
versions by manually manipulating attributes on a TypedDict class.

It's a pretty marginal bug but I would argue the extension should
be robust to this sort of edge case.
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