diff options
Diffstat (limited to 'onionshare/settings.py')
-rw-r--r-- | onionshare/settings.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/onionshare/settings.py b/onionshare/settings.py index ed827cbd..42f7259c 100644 --- a/onionshare/settings.py +++ b/onionshare/settings.py @@ -138,9 +138,13 @@ class Settings(object): """ Returns the path of the default Downloads directory for receive mode. """ - # TODO: Test in Windows, though it looks like it should work - # https://docs.python.org/3/library/os.path.html#os.path.expanduser - return os.path.expanduser('~/OnionShare') + # On Windows, os.path.expanduser() needs to use backslash, or else it + # retains the forward slash, which breaks opening the folder in explorer. + p = platform.system() + if p == 'Windows': + return os.path.expanduser('~\OnionShare') + else: + return os.path.expanduser('~/OnionShare') def load(self): """ |