summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ntpath.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-118263: Add additional arguments to path_t (Argument Clinic type) in ↵Nice Zombies2024-05-241-0/+4
| | | | posixmodule (GH-118355)
* gh-118507 : Refactor `nt._path_is*` to improve applicability for other cases ↵Nice Zombies2024-05-211-0/+25
| | | | (GH-118755)
* gh-102511: Speed up os.path.splitroot() with native helpers (GH-118089)Nice Zombies2024-04-251-0/+1
|
* gh-117381: Improve error messages for ntpath.commonpath() (GH-117382)Nice Zombies2024-04-031-50/+47
|
* gh-117335: Handle non-iterables for `ntpath.commonpath` (GH-117336)Nice Zombies2024-03-281-0/+3
|
* gh-88569: add `ntpath.isreserved()` (#95486)Barney Gale2024-01-261-0/+56
| | | | | | | | | | | Add `ntpath.isreserved()`, which identifies reserved pathnames such as "NUL", "AUX" and "CON". Deprecate `pathlib.PurePath.is_reserved()`. --------- Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* GH-44626, GH-105476: Fix `ntpath.isabs()` handling of part-absolute paths ↵Barney Gale2024-01-131-2/+10
| | | | | | | | | | | | | (#113829) On Windows, `os.path.isabs()` now returns `False` when given a path that starts with exactly one (back)slash. This is more compatible with other functions in `os.path`, and with Microsoft's own documentation. Also adjust `pathlib.PureWindowsPath.is_absolute()` to call `ntpath.isabs()`, which corrects its handling of partial UNC/device paths like `//foo`. Co-authored-by: Jon Foster <jon@jon-foster.co.uk>
* GH-112675: Move path joining tests into `test_posixpath` and `test_ntpath` ↵Barney Gale2023-12-071-0/+11
| | | | | | | | | | | (#112676) In `test_pathlib`, the `check_drive_root_parts` test methods evaluated both joining and parsing/normalisation of paths. This dates from a time when pathlib implemented both functions itself, but nowadays path joining is done with `posixpath.join()` and `ntpath.join()`. This commit moves the joining-related test cases into `test_posixpath` and `test_ntpath`.
* gh-82367: Use `FindFirstFile` Win32 API in `ntpath.realpath()` (GH-110298)박문식2023-10-051-0/+43
| | | | | | | * Use `FindFirstFile` Win32 API to fix a bug where `ntpath.realpath()` breaks out of traversing a series of paths where a (handled) `ERROR_ACCESS_DENIED` or `ERROR_SHARING_VIOLATION` occurs. * Update docs to reflect that `ntpath.realpath()` eliminates MS-DOS style names.
* gh-106242: Make ntpath.realpath errors consistent with abspath when there ↵Steve Dower2023-08-221-0/+6
| | | | | | | | | | | | | are embedded nulls (GH-108248) * gh-106242: Make ntpath.realpath errors consistent with abspath when there are embedded nulls * Update 2023-08-22-00-36-57.gh-issue-106242.q24ITw.rst mention Windows and the former incorrect ValueError. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-106844: Fix issues in _winapi.LCMapStringEx (GH-107832)Serhiy Storchaka2023-08-111-0/+1
| | | | | | | | | * Strings with length from 2**31-1 to 2**32-2 always caused MemoryError, it doesn't matter how much memory is available. * Strings with length exactly 2**32-1 caused OSError. * Strings longer than 2**32-1 characters were truncated due to integer overflow bug. * Strings containing the null character were truncated at the first null character. Now strings longer than 2**31-1 characters caused OverflowError and the null character is allowed.
* gh-104803: Implement ntpath.isdevdrive for checking whether a path is on a ↵Steve Dower2023-05-291-0/+20
| | | | Windows Dev Drive (GH-104805)
* GH-78079: Fix UNC device path root normalization in pathlib (GH-102003)Barney Gale2023-04-141-0/+8
| | | | | | | We no longer add a root to device paths such as `//./PhysicalDrive0`, `//?/BootPartition` and `//./c:` while normalizing. We also avoid adding a root to incomplete UNC share paths, like `//`, `//a` and `//a/`. Co-authored-by: Eryk Sun <eryksun@gmail.com>
* GH-103220: Fix `ntpath.join()` of partial UNC drive with trailing slash ↵Barney Gale2023-04-111-0/+5
| | | | (GH-103221)
* GH-88013: Fix TypeError raised by ntpath.realpath in some cases (GH-102813)AN Long2023-04-071-0/+7
|
* gh-101360: Fix anchor matching in pathlib.PureWindowsPath.match() (GH-101363)Barney Gale2023-02-171-0/+4
| | | | Use `fnmatch` to match path and pattern anchors, just as we do for other path parts. This allows patterns such as `'*:/Users/*'` to be matched.
* gh-101196: Make isdir/isfile/exists faster on Windows (GH-101324)Michael Droettboom2023-02-081-1/+31
| | | Co-authored-by: Eryk Sun <eryksun@gmail.com>
* gh-101000: Add os.path.splitroot() (#101002)Barney Gale2023-01-271-43/+95
| | | | Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-96290: Support partial/invalid UNC drives in ntpath.normpath() and ↵Barney Gale2023-01-121-8/+25
| | | | | | | splitdrive() (GH-100351) This brings the Python implementation of `ntpath.normpath()` in line with the C implementation added in 99fcf15 Co-authored-by: Eryk Sun <eryksun@gmail.com>
* gh-99547: Add isjunction methods for checking if a path is a junction (GH-99548)Charles Machalow2022-11-221-0/+17
|
* gh-81790: support "UNC" device paths in `ntpath.splitdrive()` (GH-91882)Barney Gale2022-06-101-0/+25
|
* bpo-42658: Use LCMapStringEx in ntpath.normcase to match OS behaviour for ↵AN Long2022-06-061-0/+2
| | | | case-folding (GH-32010)
* bpo-40280: Skip more tests on Emscripten (GH-31947)Christian Heimes2022-03-171-1/+2
| | | | | | - lchmod, lchown are not fully implemented - skip umask tests - cannot fstat unlinked or renamed files yet - ignore musl libc issues that affect Emscripten
* bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)neonene2022-01-131-0/+34
| | | This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.
* bpo-46208: Fix normalization of relative paths in ↵neonene2022-01-061-0/+9
| | | | _Py_normpath()/os.path.normpath (GH-30362)
* bpo-45582: Port getpath[p].c to Python (GH-29041)Steve Dower2021-12-031-2/+3
| | | | | The getpath.py file is frozen at build time and executed as code over a namespace. It is never imported, nor is it meant to be importable or reusable. However, it should be easier to read, modify, and patch than the previous code. This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.
* bpo-43757: Make pathlib use os.path.realpath() to resolve symlinks in a path ↵Barney Gale2021-04-281-2/+58
| | | | | (GH-25264) Also adds a new "strict" argument to realpath() to avoid changing the default behaviour of pathlib while sharing the implementation.
* bpo-39899: os.path.expanduser(): don't guess other Windows users' home ↵Barney Gale2021-04-071-15/+28
| | | | | | | directories if the basename of the current user's home directory doesn't match their username. (GH-18841) This makes `ntpath.expanduser()` match `pathlib.Path.expanduser()` in this regard, and is more in line with `posixpath.expanduser()`'s cautious approach. Also remove the near-duplicate implementation of `expanduser()` in pathlib, and by doing so fix a bug where KeyError could be raised when expanding another user's home directory.
* bpo-40275: Use new test.support helper submodules in tests (GH-21764)Hai Shi2020-08-071-6/+6
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21743)Hai Shi2020-08-061-3/+3
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21448)Hai Shi2020-08-031-38/+40
|
* bpo-41069: Make TESTFN and the CWD for tests containing non-ascii ↵Serhiy Storchaka2020-06-251-1/+1
| | | | characters. (GH-21035)
* bpo-38453: Ensure correct short path is obtained for test (GH-17184)Steve Dower2019-11-161-3/+21
|
* bpo-38453: Ensure ntpath.realpath correctly resolves relative paths (GH-16967)Steve Dower2019-11-151-12/+40
| | | | | Ensure isabs() is always True for \\?\ prefixed paths Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly Ensure shutil tests run in test directory
* bpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)Steve Dower2019-10-031-7/+5
|
* bpo-38081: Fixes ntpath.realpath('NUL') (GH-15899)Steve Dower2019-09-111-0/+4
|
* bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath (GH-15850)Steve Dower2019-09-101-91/+105
|
* bpo-9949: Call normpath() in realpath() and avoid unnecessary prefixes ↵Steve Dower2019-08-211-2/+2
| | | | (GH-15369)
* bpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)Steve Dower2019-08-211-3/+195
|
* bpo-37393: Fix deprecation warnings in test_ntpath. (GH-14357)Zackery Spytz2019-06-251-2/+0
| | | | eval() was being called an extra time without a filter for deprecation warnings.
* bpo-36264: Don't honor POSIX HOME in os.path.expanduser on Windows (GH-12282)Anthony Sottile2019-03-121-10/+11
|
* bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082)Tim Graham2018-10-251-0/+2
| | | Regression in b0bf51b32240369ccb736dc32ff82bb96f375402.
* bpo-31047: Fix ntpath.abspath for invalid paths (GH-8544)Franz Wöllert2018-07-291-0/+4
|
* bpo-34195: Fix case-sensitive comparison in test_nt_helpers (GH-8448)Tim Golden2018-07-251-5/+11
| | | | | * Fix case-sensitive comparison test_nt_helpers assumed that two versions of a Windows path could be compared case-sensitively. This is not the case, and the difference can be triggered (apparently) by running the test on a path somewhere below a Junction.
* bpo-32964: Reuse a testing implementation of the path protocol in tests. (#5930)Serhiy Storchaka2018-03-021-12/+3
|
* bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage ↵Steve Dower2018-02-221-10/+36
| | | | now correctly convert from bytes. (GH-5761)
* Issue #29197: Removed deprecated function ntpath.splitunc().Serhiy Storchaka2017-01-131-24/+1
|
* Issue #26027, #27524: Add PEP 519/__fspath__() support to os andBrett Cannon2016-08-261-0/+83
| | | | | | os.path. Thanks to Jelle Zijlstra for the initial patch against posixmodule.c.
* Issue #10395: Added os.path.commonpath(). Implemented in posixpath and ntpath.Serhiy Storchaka2015-03-311-0/+69
| | | | Based on patch by Rafik Draoui.
* Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes.Serhiy Storchaka2015-03-251-0/+1
|