GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — GH-44626, GH-105476: Fix `ntpath.isabs()` handling of part-absolute paths by barneygale · Pull Request #113829 · python/cpython Conversation
|
|
Thank you for the review @zooba! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…t-absolute paths (python#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 <[email protected]>
…t-absolute paths (python#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 <[email protected]>
…t-absolute paths (python#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 <[email protected]>
…path.isabs change (#7482) # References and relevant issues Needed by: #7481 # Description Python 3.13 changed how `os.path.isabs` works on Windows: python/cpython#113829 Specifically, it will now return False for paths like `/foo/bar` on Windows, while True on POSIX. For True on Windows the path now needs to be `\\foo\bar` We have 2 tests that use paths like `/foo/bar` and expect them to be considered absolute. In this PR, I add logic to test the proper paths on Windows using `\`. You can see all tests pass on 3.13 with this fix in my fork: https://github.com/psobolewskiPhD/napari/actions/runs/12574076907/job/35047736273 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
python/cpython#113829 changed `os.path.isabs` on Windows to not consider a path starting a single backslash to be an absolute path. We do a lot of naive `posixpath` to `ntpath` conversions, and it broke DVC in multiple places. DVC is likely broken in many other places, and these bugs are difficult to identify. In this commit, I have tried to fix in the places where the tests failed. And mostly by trying to imitate pre-3.13 behaviour. Some of the changes may not be correct but keeps the old behaviour in place. Also re-enabled the CI for all Python versions supported for Windows.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.