Skip to content

Commit

Permalink
Skip inaccessible paths for default data dir resolution. (#8812)
Browse files Browse the repository at this point in the history
* Skip inaccessible paths for default data dir resolution.

* fixup! Skip inaccessible paths for default data dir resolution.
  • Loading branch information
lhunath authored Dec 10, 2024
1 parent c7128a8 commit cd64d0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sickchill/helper/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import platform
import re
import uuid
import os
from fnmatch import fnmatch
from os import PathLike
from pathlib import Path
Expand Down Expand Up @@ -440,6 +441,6 @@ def choose_data_dir(program_dir) -> Path:
proper_data_dir = Path(appdirs.user_config_dir(appname="sickchill"))
for location in [old_data_dir, old_profile_path, proper_data_dir]:
for check in ["sickbeard.db", "sickchill.db", "config.ini"]:
if location.joinpath(check).exists():
if os.access(location.joinpath(check), os.R_OK):
return location.resolve()
return proper_data_dir.resolve()

0 comments on commit cd64d0a

Please sign in to comment.