From e0630cadd345a1b368a2f552cbae08ac1e4da3c6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Oct 2019 10:27:48 +0530 Subject: [PATCH] Viewer: Fix failing to open books if path to cache contains symbolic links. Fixes #1846834 [symlinked .cache cause calibre 4 reader fail](https://bugs.launchpad.net/calibre/+bug/1846834) --- src/calibre/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index f7aab6454a..857687120b 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -146,7 +146,7 @@ def _get_cache_dir(): def cache_dir(): ans = getattr(cache_dir, 'ans', None) if ans is None: - ans = cache_dir.ans = _get_cache_dir() + ans = cache_dir.ans = os.path.realpath(_get_cache_dir()) return ans