Prophylactically expand ~ for wine prefix access.

It should be expanded, but just in case it is not.
This commit is contained in:
Daniel Johnson 2023-10-25 18:37:13 -04:00
parent c09097491f
commit f557e1c486
2 changed files with 3 additions and 2 deletions

View file

@ -613,7 +613,7 @@ class GameDialogCommon(SavableModelessDialog, DialogInstallUIDelegate):
except ValueError:
ErrorDialog(_("The entered playtime is invalid"), parent=self)
return False
invalid_fields = []
runner_class = import_runner(self.runner_name)
runner_instance = runner_class()

View file

@ -47,7 +47,8 @@ class WinePrefixManager:
def __init__(self, path):
if not path:
logger.warning("No path specified for Wine prefix")
self.path = path
# expanduser() just in case- it should already be expanded.
self.path = os.path.expanduser(path)
def get_user_dir(self, default_user=None):
user = default_user or os.getenv("USER") or "lutrisuser"