-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-102765: Updated isdir/isfile/islink/exists to use Py_GetFileInformationByName in ntpath when available #103485
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
Merged
+209
−118
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b9c4dbe
pythongh-102765: added _Py_GetFileInformationByName to isdir
finnagin 9faeafa
Merge branch 'python:main' into gh-102765
finnagin a136922
enable actions workflows for branch
finnagin a1a3fa5
pythongh-102765: add missing curly brace, fix whitespace
finnagin aa984f2
pythongh-102765: added _Py_GetFileInformationByName to exists & isfile
finnagin fb95b7f
pythongh-102765: added _Py_GetFileInformationByName to islink, altere…
finnagin 83de4de
fix whitespace, remove unneeded comments
finnagin 1b47b63
add results
finnagin 43e203d
added result for slow_path excluding errors
finnagin 0d373d1
skip isdir/isfile slow path if not a dir/file
finnagin 82cab87
Merge branch 'python:main' into gh-102765
finnagin 25fbf06
Merge branch 'python:main' into gh-102765
finnagin 4278113
remove extra close_file
finnagin c3b9d32
merge python:main into 102765
finnagin 9b2544d
merge python:main into 102765
finnagin 9be05ae
merge python:main into 102765
finnagin 97dc17d
merge python:main into 102765
finnagin 72ed317
change path -> _path.wide
finnagin 0e6bd58
merge python:main into 102765
finnagin a78f697
merge python:main into 102765
finnagin 36e8a9d
merge python:main into 102765
finnagin b1593af
merge python:main into 102765
finnagin 94f8eeb
revert branch addition in actions workflow
finnagin 86b323d
merge python:main into 102765
finnagin 5aa3e8a
Excluded additional errors from slow fallback path
finnagin 3338503
Disable slow path in islink on any successful GetFileInformationByNam…
finnagin 9eb3e37
move error switch into static inline function
finnagin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-102765: added _Py_GetFileInformationByName to islink, altered slow…
…_path logic
- Loading branch information
commit fb95b7fd4db367e4795919e753cbea1d3d86a489
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of bugs slipped by when the new accelerator functions were added. These bugs should probably be resolved in a separate issue before this pull request gets merged.
_Py_get_osfhandle_noraise()fails (e.g. a bad file descriptor), the result isINVALID_HANDLE_VALUE, but the thread's last error isn't set and is thus a random error code. It could be one of the errors that's handled by callingSTAT(), but in this case there is no_path.widevalue to check. It happens thatCreateFileW()doesn't raise an OS exception that crashes the process when passed a null pointer forlpFileName, but that's not documented and shouldn't be relied on.GetFileType(hfile)isn'tFILE_TYPE_DISK, we have to return a false result. Since we didn't open the file, we don't know whether or not it has a pending synchronous operation that's blocked indefinitely. For example, a pipe or character file could have a pending synchronous read that may never complete. In this case,GetFileInformationByHandleEx()would block.