mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-27 08:19:41 -05:00
Fixed crash in Windows, related to HS directory path and slashes
This commit is contained in:
parent
d67d5010d1
commit
e60a82ad22
@ -95,10 +95,11 @@ class HS(object):
|
||||
else:
|
||||
# come up with a hidden service directory name
|
||||
if helpers.get_platform() == 'Windows':
|
||||
path = '{0:s}/onionshare'.format(os.environ['Temp'].replace('\\', '/'))
|
||||
self.hidserv_dir = tempfile.mkdtemp()
|
||||
self.hidserv_dir = self.hidserv_dir.replace('\\', '/')
|
||||
|
||||
else:
|
||||
path = '/tmp/onionshare'
|
||||
|
||||
try:
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path, 0700)
|
||||
@ -108,6 +109,7 @@ class HS(object):
|
||||
raise HSDirError(strings._("error_hs_dir_not_writable").format(path))
|
||||
|
||||
self.hidserv_dir = tempfile.mkdtemp(dir=path)
|
||||
|
||||
self.cleanup_filenames.append(self.hidserv_dir)
|
||||
|
||||
# set up hidden service
|
||||
|
Loading…
Reference in New Issue
Block a user