diff --git a/dvc/ui/__init__.py b/dvc/ui/__init__.py index edc40479a..c0466329f 100644 --- a/dvc/ui/__init__.py +++ b/dvc/ui/__init__.py @@ -270,7 +270,9 @@ class Console: path = Path(file).resolve() url = ( - relpath(path) if "Microsoft" in uname().release else path.as_uri() + relpath(path) + if "microsoft" in uname().release.lower() + else path.as_uri() ) opened = webbrowser.open(url) diff --git a/tests/unit/command/test_plots.py b/tests/unit/command/test_plots.py index 6165373b4..9d007c3fb 100644 --- a/tests/unit/command/test_plots.py +++ b/tests/unit/command/test_plots.py @@ -178,7 +178,7 @@ def test_plots_diff_open(tmp_dir, dvc, mocker, capsys, plots_data, auto_open): def test_plots_diff_open_WSL(tmp_dir, dvc, mocker, plots_data): mocked_open = mocker.patch("webbrowser.open", return_value=True) mocked_uname_result = mocker.MagicMock() - mocked_uname_result.release = "Microsoft" + mocked_uname_result.release = "microsoft" mocker.patch("platform.uname", return_value=mocked_uname_result) cli_args = parse_args(