Add fast Windows implementation for os.path.isjunction
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- operating-systems
Research direction
Review the optimization discussed in #101324 and the entry points nt._isjunction(), ntpath.isjunction(), DirEntry.is_junction(), and pathlib.Path.is_junction(). Compare junction detection with the existing islink(), including the LSTAT fallback and mount-point reparse tag behavior. Done means the Windows implementation provides the requested behavior and an approximately 25% speedup without regressing shutil.rmtree() or pathlib.Path.is_junction().
Written by the indexing model from the issue text.
Description
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().
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 558
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python/cpython
-
docs pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
build type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
stdlib topic-email type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenHands/extensions#626 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
CSCfi/sd-search-api#39 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
StevenBlack/hosts#3255 ·