KEMBAR78
Fix case mismatching modules during namespace package search by nipunn1313 · Pull Request #11261 · python/mypy · GitHub
Skip to content

Conversation

nipunn1313
Copy link
Contributor

For example from a import B should not find a namespace
package a/B/. Fix by using case aware isdir on fscache.

Helps unblock #9636

Test Plan

There are several existing tests for this area. I split one of the tests by namespace package for straddling.
I also tested this diff on top of #9636 and confirmed it helps!

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, in general looks good, but not sure about the rename... It looks like this would still return True if the path exists and was a file, unlike os.path.isdir, so exists_case seems more appropriate.

For example `from a import B` should not find a namespace
package `a/B/`. Fix by using case aware isdir on fscache.
@nipunn1313
Copy link
Contributor Author

makes sense to me - switched it back to exists_case

@hauntsaninja hauntsaninja merged commit c807277 into python:master Oct 4, 2021
@nipunn1313 nipunn1313 deleted the insensitive branch October 4, 2021 17:10
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