escape spaces in paths given to reveal()

This commit is contained in:
Jack 2016-05-30 04:37:34 -04:00
parent f9c644b964
commit 4cd1cdf495

View file

@ -2229,9 +2229,9 @@ class LBRYDaemon(jsonrpc.JSONRPC):
path = p['path']
if sys.platform == "darwin":
d = threads.deferToThread(subprocess.Popen, ("open -R %s" % path), shell=True)
d = threads.deferToThread(subprocess.Popen, ("open -R %s" % path.replace(' ', '\ ')), shell=True)
else:
d = threads.deferToThread(subprocess.Popen, ("xdg-open %s" % path), shell=True)
d = threads.deferToThread(subprocess.Popen, ("xdg-open %s" % path.replace(' ', '\ ')), shell=True)
d.addCallback(lambda _: self._render_response(True, OK_CODE))
return d