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

gh-102765: Updated isdir/isfile/islink/exists to use Py_GetFileInformationByName in ntpath when available #103485

Merged
merged 27 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b9c4dbe
pythongh-102765: added _Py_GetFileInformationByName to isdir
finnagin Mar 27, 2023
9faeafa
Merge branch 'python:main' into gh-102765
finnagin Mar 27, 2023
a136922
enable actions workflows for branch
finnagin Mar 27, 2023
a1a3fa5
pythongh-102765: add missing curly brace, fix whitespace
finnagin Mar 27, 2023
aa984f2
pythongh-102765: added _Py_GetFileInformationByName to exists & isfile
finnagin Mar 27, 2023
fb95b7f
pythongh-102765: added _Py_GetFileInformationByName to islink, altere…
finnagin Mar 28, 2023
83de4de
fix whitespace, remove unneeded comments
finnagin Mar 28, 2023
1b47b63
add results
finnagin Mar 28, 2023
43e203d
added result for slow_path excluding errors
finnagin Mar 28, 2023
0d373d1
skip isdir/isfile slow path if not a dir/file
finnagin Mar 28, 2023
82cab87
Merge branch 'python:main' into gh-102765
finnagin Mar 28, 2023
25fbf06
Merge branch 'python:main' into gh-102765
finnagin Mar 29, 2023
4278113
remove extra close_file
finnagin Mar 29, 2023
c3b9d32
merge python:main into 102765
finnagin Mar 29, 2023
9b2544d
merge python:main into 102765
finnagin Mar 30, 2023
9be05ae
merge python:main into 102765
finnagin Mar 30, 2023
97dc17d
merge python:main into 102765
finnagin Mar 31, 2023
72ed317
change path -> _path.wide
finnagin Apr 3, 2023
0e6bd58
merge python:main into 102765
finnagin Apr 3, 2023
a78f697
merge python:main into 102765
finnagin Apr 3, 2023
36e8a9d
merge python:main into 102765
finnagin Apr 11, 2023
b1593af
merge python:main into 102765
finnagin Apr 12, 2023
94f8eeb
revert branch addition in actions workflow
finnagin Apr 12, 2023
86b323d
merge python:main into 102765
finnagin Apr 13, 2023
5aa3e8a
Excluded additional errors from slow fallback path
finnagin Apr 13, 2023
3338503
Disable slow path in islink on any successful GetFileInformationByNam…
finnagin Apr 13, 2023
9eb3e37
move error switch into static inline function
finnagin Apr 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Include/internal/pycore_fileutils_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,24 @@ static inline BOOL _Py_GetFileInformationByName(
return GetFileInformationByName(FileName, FileInformationClass, FileInfoBuffer, FileInfoBufferSize);
}

static inline BOOL _Py_GetFileInformationByName_ErrorIsTrustworthy(int error)
{
switch(error) {
case ERROR_FILE_NOT_FOUND:
case ERROR_PATH_NOT_FOUND:
case ERROR_NOT_READY:
case ERROR_BAD_NET_NAME:
case ERROR_BAD_NETPATH:
case ERROR_BAD_PATHNAME:
case ERROR_INVALID_NAME:
case ERROR_FILENAME_EXCED_RANGE:
return TRUE;
case ERROR_NOT_SUPPORTED:
return FALSE;
}
return FALSE;
}

#endif

#endif
Loading