Skip to content
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

Reject fake TypeInfos for TypedDict fallbacks #7195

Merged
merged 1 commit into from Jul 11, 2019

Conversation

@ilevkivskyi
Copy link
Collaborator

commented Jul 11, 2019

This avoids possible crashes during calculations of meets and joins on a cold update.

We do this by rejecting a fake ad-hoc TypeInfo created by fixup.py if a file containing the typed dict fallback was deleted, and instead using the generic typing._TypedDict fallback.

@ilevkivskyi ilevkivskyi requested a review from JukkaL Jul 11, 2019
@ilevkivskyi

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 11, 2019

@JukkaL if you think this is relatively safe, then we can merge this in release branch, otherwise I think it is not critical because this is kind of an old issue (see e.g. the second test).

@JukkaL
JukkaL approved these changes Jul 11, 2019
Copy link
Collaborator

left a comment

Thanks for the quick fix! This looks safe enough to cherry-pick, but it's up to you. I agree that it doesn't look urgent.

Is a similar issue possible with named tuples?

@ilevkivskyi

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 11, 2019

I played more with the named tuples and they seem safe (mostly because fallbacks are computed on the fly, but also several places are guarded with if foo.tuple_type is not None).

@ilevkivskyi ilevkivskyi merged commit ac24ed3 into python:master Jul 11, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ilevkivskyi ilevkivskyi deleted the ilevkivskyi:fix-typeddict-fallback branch Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.