[Pkg-privacy-commits] [onionshare] 62/256: Catch exceptions for guessing default Tor Browser socket file path

Ulrike Uhlig ulrike at moszumanska.debian.org
Fri May 26 12:53:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

ulrike pushed a commit to branch master
in repository onionshare.

commit f14b5ebfa1f798f7dfde5076107e59a20dd6babc
Author: Micah Lee <micah at micahflee.com>
Date:   Fri Jan 6 11:54:42 2017 -0800

    Catch exceptions for guessing default Tor Browser socket file path
---
 onionshare/onion.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/onionshare/onion.py b/onionshare/onion.py
index 483d019..bb5a31a 100644
--- a/onionshare/onion.py
+++ b/onionshare/onion.py
@@ -135,11 +135,14 @@ class Onion(object):
                 # If this still didn't work, try guessing the default socket file path
                 socket_file_path = ''
                 if not found_tor:
-                    if p == 'Darwin':
-                        socket_file_path = os.path.expanduser('~/Library/Application Support/TorBrowser-Data/Tor/control.socket')
+                    try:
+                        if p == 'Darwin':
+                            socket_file_path = os.path.expanduser('~/Library/Application Support/TorBrowser-Data/Tor/control.socket')
 
-                    self.c = Controller.from_socket_file(path=socket_file_path)
-                    found_tor = True
+                        self.c = Controller.from_socket_file(path=socket_file_path)
+                        found_tor = True
+                    except:
+                        pass
 
             # If connecting to default control ports failed, so let's try
             # guessing the socket file name next

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git



More information about the Pkg-privacy-commits mailing list