You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix IsADirectoryError for namespace packages when using --linecoverage-report (#20109)
Fixes#18128. This fixes an Internal Error where namespace packages were
not supported properly. This fix was inspired by @sterliakov noticing
that this bug was very similar to #19843, which has a similar fix. Note
that we 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](https://discuss.python.org/t/permissionerror-errno-13-permission-denied-python-2023/22360/8),
which makes `except IsADirectoryError` unreliable. (We also can't just
`except (IsADirectoryError, PermissionError)` because what if there is
an actual permission error?) Anyway, we just early-return — which, based
on my manual testing and reading the code, seems to be the right thing
to do here.
---------
Co-authored-by: Ivan Levkivskyi <[email protected]>
0 commit comments