From 050dcbce446ee942b809417583ca2233eeacdfa9 Mon Sep 17 00:00:00 2001 From: Flowseal Date: Tue, 30 Jun 2026 19:11:01 +0300 Subject: [PATCH] fixes #1072 #1060 --- ui/i18n/__init__.py | 5 ++++- utils/tray_common.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/i18n/__init__.py b/ui/i18n/__init__.py index ecb91d1..b417658 100644 --- a/ui/i18n/__init__.py +++ b/ui/i18n/__init__.py @@ -25,7 +25,10 @@ class LocaleEnum(str, Enum): return _DEFAULT_LOCALE -_LOCALES_DIR = Path(__file__).resolve().parent +try: + _LOCALES_DIR = Path(__file__).resolve(strict=False).parent +except OSError: + _LOCALES_DIR = Path(os.path.realpath(__file__)).parent _DEFAULT_LOCALE = LocaleEnum.english _translations: Dict[str, str] = {} diff --git a/utils/tray_common.py b/utils/tray_common.py index 503dc4e..d4bc21b 100644 --- a/utils/tray_common.py +++ b/utils/tray_common.py @@ -41,7 +41,10 @@ def _exe_dir() -> Optional[Path]: return None if not base: return None - p = Path(base).resolve() + try: + p = Path(base).resolve(strict=False) + except OSError: + p = Path(os.path.realpath(base)) return p.parent if p.is_file() else p