mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 00:39:37 -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:
|
else:
|
||||||
# come up with a hidden service directory name
|
# come up with a hidden service directory name
|
||||||
if helpers.get_platform() == 'Windows':
|
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:
|
else:
|
||||||
path = '/tmp/onionshare'
|
path = '/tmp/onionshare'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
os.makedirs(path, 0700)
|
os.makedirs(path, 0700)
|
||||||
@ -108,6 +109,7 @@ class HS(object):
|
|||||||
raise HSDirError(strings._("error_hs_dir_not_writable").format(path))
|
raise HSDirError(strings._("error_hs_dir_not_writable").format(path))
|
||||||
|
|
||||||
self.hidserv_dir = tempfile.mkdtemp(dir=path)
|
self.hidserv_dir = tempfile.mkdtemp(dir=path)
|
||||||
|
|
||||||
self.cleanup_filenames.append(self.hidserv_dir)
|
self.cleanup_filenames.append(self.hidserv_dir)
|
||||||
|
|
||||||
# set up hidden service
|
# set up hidden service
|
||||||
|
Loading…
Reference in New Issue
Block a user