microsoft / pyright

Static Type Checker for Python
Other
13.12k stars 1.4k forks source link

Handle undefined python versions #8818

Closed rchiodo closed 3 weeks ago

rchiodo commented 3 weeks ago

While testing our latest release, we had an undefined PythonVersion happen at this point here: https://github.com/microsoft/pyrx/blob/c1a1f8f062d3391f32b2c1ecc0e25082cf6a794c/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L2002

Which caused a crash.

This change makes PythonVersion handle undefined.

github-actions[bot] commented 3 weeks ago

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] commented 3 weeks ago

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

rchiodo commented 3 weeks ago

It might be that the PythonVersion being undefined is the bug in the first place. We're doing more investigating.

rchiodo commented 3 weeks ago

There was a bug on our side with serializing PythonVersions. Closing for now.