X Tutup
The Wayback Machine - https://web.archive.org/web/20250528005038/https://github.com/python/cpython/issues/101356
Skip to content

Add fast Windows implementation for os.path.isjunction #101356

Open
@mdboom

Description

@mdboom

Feature or enhancement

In #101324, @eryksun pointed out that we could also optimize os.path.isjunction(), and would like see the same ~25% speedup as for isdir, isfile and islink:

Maybe also add nt._isjunction() for the new ntpath.isjunction() test in 3.12. It's like islink(), except it checks for the tag IO_REPARSE_TAG_MOUNT_POINT. In the LSTAT fallback, it would check st.st_reparse_tag == IO_REPARSE_TAG_MOUNT_POINT.

It's not critical to support this since we don't have use cases for it yet in the standard library. Currently DirEntry.is_junction() is used by shutil.rmtree(), but ntpath.isjunction() is only used by pathlib.Path.is_junction().

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsperformancePerformance or resource usagestdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup