diff --git a/plugin/commands/open_git_repo_on_web.py b/plugin/commands/open_git_repo_on_web.py index 40ee0b0..52acf22 100644 --- a/plugin/commands/open_git_repo_on_web.py +++ b/plugin/commands/open_git_repo_on_web.py @@ -5,10 +5,9 @@ import shutil import subprocess import threading -from collections.abc import Callable from functools import wraps from pathlib import Path -from typing import Any, TypeVar, cast +from typing import Any, Callable, TypeVar, cast import sublime import sublime_plugin diff --git a/plugin/commands/open_sublime_text_dir.py b/plugin/commands/open_sublime_text_dir.py index 530116b..3c4a069 100644 --- a/plugin/commands/open_sublime_text_dir.py +++ b/plugin/commands/open_sublime_text_dir.py @@ -7,16 +7,24 @@ import sublime import sublime_plugin +assert __package__ + PACKAGE_NAME = __package__.partition(".")[0] @lru_cache def _get_folder_map() -> dict[str, str]: + def may_resolve_path(path: Path) -> Path: + try: + return path.resolve() # will fail on a Direct-IO disk + except OSError: + return path + cache_path = Path(sublime.cache_path()) packages_path = Path(sublime.packages_path()) return { - name: str(path.resolve()) + name: str(may_resolve_path(path)) for name, path in ( # from OS ("home", Path.home()),