mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-05 23:09:32 +01:00
* add: prevent crash while getting relpath Since python 3.8 os.path.realpath has resolved windows network shares to UNC paths. This breaks the logic for relpath as the UNC and mapped drive paths don't have an obvious common prefix. As it is not easy to go back to the mapped drive path from UNC path, this is resolved by always using the UNC paths for calculating relative paths in windows. Fixes #5832 * relpath: Update changes following review Two changes: - use pytest.mark.skipif rather than if statement inside test to make it clearer that test is windows specific - Use tail rather than upper_path to denote rest of path after drive name taken off (to match python documentation) Pull request: #5837 * tests, linter: update to add test case and apply linter though pre-commit Co-authored-by: Tom Rutter <[email protected]>