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

Fix infinite loop in isThirdPartyPyTypedPresent logic of _getModuleNameForImport #6233

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

debonte
Copy link
Collaborator

@debonte debonte commented Oct 25, 2023

Addresses #6232

getRootLength wasn't handling URIs without authority (single slash after colon) correctly. In the case of untitled:/ (length 10) it was returning 11 under the assumption that there were two trailing slashes. This caused isDiskPathRoot to incorrectly return false. If isDiskPathRoot returns true instead, _tryWalkUp will return false thus causing the _shouldWalkUp loop to exit.

@github-actions
Copy link
Contributor

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

@debonte debonte merged commit fa276dd into microsoft:main Oct 25, 2023
12 checks passed
@debonte debonte deleted the loopFix branch October 25, 2023 20:55
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.

3 participants