| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
posixmodule (GH-118355)
|
|
|
|
| |
(GH-118755)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#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>
|
|
|
|
|
|
|
|
|
|
|
| |
(#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`.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
Windows Dev Drive (GH-104805)
|
|
|
|
|
|
|
| |
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-103221)
|
| |
|
|
|
|
| |
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.
|
|
|
| |
Co-authored-by: Eryk Sun <eryksun@gmail.com>
|
|
|
|
| |
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
|
| |
case-folding (GH-32010)
|
|
|
|
|
|
| |
- lchmod, lchown are not fully implemented
- skip umask tests
- cannot fstat unlinked or renamed files yet
- ignore musl libc issues that affect Emscripten
|
|
|
| |
This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.
|
|
|
|
| |
_Py_normpath()/os.path.normpath (GH-30362)
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
(GH-25264)
Also adds a new "strict" argument to realpath() to avoid changing the default behaviour of pathlib while sharing the implementation.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
characters. (GH-21035)
|
| |
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
| |
(GH-15369)
|
| |
|
|
|
|
| |
eval() was being called an extra time without a filter for
deprecation warnings.
|
| |
|
|
|
| |
Regression in b0bf51b32240369ccb736dc32ff82bb96f375402.
|
| |
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
| |
now correctly convert from bytes. (GH-5761)
|
| |
|
|
|
|
|
|
| |
os.path.
Thanks to Jelle Zijlstra for the initial patch against posixmodule.c.
|
|
|
|
| |
Based on patch by Rafik Draoui.
|
| |
|