Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9a7d3d8
Make isdir/isfile/exists faster on Windows
mdboom Jan 25, 2023
a07f1e7
Fix doc syntax
mdboom Jan 25, 2023
7765fea
Merge branch 'main' into win-isdir-fastpath
mdboom Jan 25, 2023
684d683
Fix doc syntax
mdboom Jan 25, 2023
781fa07
Update Lib/ntpath.py
mdboom Jan 25, 2023
dda7be7
Mark test as CPython-only
mdboom Jan 25, 2023
565c2e1
Handle files correctly
mdboom Jan 25, 2023
53b932b
Remove unused variable
mdboom Jan 25, 2023
f6ce580
Add islink
mdboom Jan 25, 2023
88c8b25
Update CHANGELOG entry
mdboom Jan 25, 2023
39beb86
Handle uncommon error cases
mdboom Jan 26, 2023
9d4af5a
Fix drive test
mdboom Jan 26, 2023
1030d8a
Update Lib/test/test_ntpath.py
mdboom Jan 26, 2023
be6b592
Use STAT and LSTAT macros
mdboom Jan 26, 2023
0e465dc
Fix and add more tests
mdboom Jan 26, 2023
8fff56b
Merge remote-tracking branch 'origin/win-isdir-fastpath' into win-isd…
mdboom Jan 26, 2023
dcb9513
Don't unnecessarily zero-out info
mdboom Jan 31, 2023
0d2985d
Fix spelling of Win32
mdboom Jan 31, 2023
19018dc
PEP7
mdboom Jan 31, 2023
7583a1d
Reduce use of else
mdboom Jan 31, 2023
30cf754
Remove variable declarations
mdboom Jan 31, 2023
c0991ec
Docstring improvements
mdboom Jan 31, 2023
3400f07
No need for 'error' local variable
mdboom Jan 31, 2023
cb7cea3
Update generated code
mdboom Jan 31, 2023
636886e
PEP7
mdboom Jan 31, 2023
05c9165
Make docs consistent
mdboom Jan 31, 2023
5818815
Merge branch 'main' into win-isdir-fastpath
mdboom Jan 31, 2023
ff6bca9
Revert docstrings to the equivalent Python ones
mdboom Feb 1, 2023
6d48808
Revert docs changes
mdboom Feb 1, 2023
c7128bc
Move islink to genericpath.py
mdboom Feb 1, 2023
a72aba0
Regenerate clinic
mdboom Feb 1, 2023
aac93e4
Rename and reorganize - _isdir -> _path_isdir etc.
mdboom Feb 3, 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
Prev Previous commit
Next Next commit
Fix drive test
  • Loading branch information
mdboom committed Jan 26, 2023
commit 9d4af5a134ca6dbe24ca90aa6a58513830ce741b
2 changes: 1 addition & 1 deletion Lib/test/test_ntpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ def test_isjunction(self):

@unittest.skipIf(sys.platform != 'win32', "drive letters are a windows concept")
def test_isfile_driveletter(self):
current_drive = os.path.splitdrive(os.path.abspath(__file__))[0] + "\\"
current_drive = "\\\\.\\" + os.path.splitdrive(os.path.abspath(__file__))[0]
self.assertFalse(os.path.isfile(current_drive))
Copy link
Contributor

@eryksun eryksun Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this is false is because a relative drive path like "C:" resolves to the working directory on the drive. Did you want to test a volume device path like r'\\.\C:' instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes. And this is exactly the thing that (erroneously) returns True without checking the error code from GetFileInformationByHandleEx.


@unittest.skipIf(sys.platform != 'win32', "Fast paths are only for win32")
Expand Down