| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…t-absolute paths. 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>
|
Thank you for the review @zooba! |
Sorry, something went wrong.
…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 <jon@jon-foster.co.uk>
…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 <jon@jon-foster.co.uk>
…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 <jon@jon-foster.co.uk>
…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.
| Back | FazBrowse Home | New Git URL |
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.
📚 Documentation preview 📚: https://cpython-previews--113829.org.readthedocs.build/