Skip to content

Conversation

@wyattscarpenter
Copy link
Contributor

Fixes #19843

This fixes an Internal Error where namespace packages were not supported properly. We have to use os.path.isdir(tree.path) instead of trying to catch an IsADirectoryError exception because of a bug on Windows which causes it to throw a PermissionError instead in the relevant situation, which makes except IsADirectoryError unreliable. (We also can't just except (IsADirectoryError, PermissionError) because what if there is an actual permission error?)

@github-actions
Copy link
Contributor

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

@wyattscarpenter wyattscarpenter marked this pull request as ready for review October 24, 2025 11:55
Copy link
Collaborator

@sterliakov sterliakov left a comment

Choose a reason for hiding this comment

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

Nice batch, thanks!

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.

INTERNAL ERROR when creating cobertura output for namespace package

2 participants