Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle the case where source drive and cwd drive differ (#17125)
Summary of the issue: `markdownTranslate.prettyPathString` was using `os.path.relpath` without preventing or catching errors raised by that method. This was causing unit tests to fail for users whose development takes place on a separate drive to their Windows user account folder, as `ntpath.relpath` raises `ValueError` when the drives differ. Description of user facing changes None. Description of developer facing changes Unit tests now run properly when the NVDA repo and developer's user directory are on different drives. This may also fix translation for users with such set-ups, though I'm not sure if this was broken for them. Description of development approach Added a check to see if the drives of the given path and the CWD differ, and if so, return the given path unchanged. Otherwise, calculate and return the relative path. Testing strategy: Ran unittests to ensure they now pass.
- Loading branch information