Skip to content

Windows os.path.isdir has different signature #109782

Closed
@aminalaee

Description

@aminalaee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions