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

Windows os.path.isdir has different signature #109782

Closed
aminalaee opened this issue Sep 23, 2023 · 1 comment
Closed

Windows os.path.isdir has different signature #109782

aminalaee opened this issue Sep 23, 2023 · 1 comment
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@aminalaee
Copy link
Contributor

aminalaee commented Sep 23, 2023

Bug report

Bug description:

In this PR #101324 and issue #101196 the optimized methods of isdir and isfile were added for windows. If not available they will fall back to genericpath implementations.

The issue with isdir is that this introduced a different signature compared to genericpath:

# in genericpath.py
def isdir(s) -> bool: ...

# in optimized nt module
def isdir(path) -> bool: ...

I'm not sure if this was intentional to have different signatures depending on the platform, and there's any possibility to fix this now. Ref: python/typeshed#10751

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

@aminalaee aminalaee added the type-bug An unexpected behavior, bug, or error label Sep 23, 2023
@AlexWaygood AlexWaygood added 3.12 bugs and security fixes 3.13 bugs and security fixes labels Sep 23, 2023
@sobolevn
Copy link
Member

CC @zooba and @mdboom

aminalaee added a commit to aminalaee/cpython that referenced this issue Sep 23, 2023
aminalaee added a commit to aminalaee/cpython that referenced this issue Sep 23, 2023
@zooba zooba closed this as completed Sep 28, 2023
csm10495 pushed a commit to csm10495/cpython that referenced this issue Sep 29, 2023
AlexWaygood pushed a commit to AlexWaygood/cpython that referenced this issue Oct 2, 2023
AlexWaygood added a commit that referenced this issue Oct 2, 2023
…l platforms (GH-109790) (#110233)

gh-109782: Ensure `os.path.isdir` has the same signature on all platforms (GH-109790)

Co-authored-by: Amin Alaee <mohammadamin.alaee@gmail.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants