Opened 7 years ago

Closed 6 years ago

#8371 closed defect (fixed)

UnboundLocalError: local variable 'hdlr' referenced before assignment

Reported by: arma Owned by: aagbsn
Priority: Medium Milestone:
Component: Core Tor/Torflow Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

ERROR[Thu Feb 28 21:33:17 2013]:An unexpected error occured.
Traceback (most recent call last):
  File "bwauthority_child.py", line 391, in <module>
    else: main(sys.argv)
  File "bwauthority_child.py", line 313, in main
    hdlr.attach_sql_listener('sqlite://')
UnboundLocalError: local variable 'hdlr' referenced before assignment

Running Torflow caf001962.

Child Tickets

Change History (3)

comment:1 Changed 7 years ago by arma

I think this happens when it failed to connect to the Tor control port.

Which is a separate issue, but it probably shouldn't result in trying to do the hdlr attach anyway if things aren't initialized enough.

comment:2 Changed 7 years ago by aagbsn

I think this will do the trick:

diff --git a/NetworkScanners/BwAuthority/bwauthority_child.py b/NetworkScanners/BwAuthority/bwauthority_child.py
index be9d5fe..5466e16 100755
--- a/NetworkScanners/BwAuthority/bwauthority_child.py
+++ b/NetworkScanners/BwAuthority/bwauthority_child.py
@@ -24,6 +24,7 @@ import sqlalchemy
 import sets
 import re
 import random
+from signal import SIGKILL
 
 sys.path.append("../../")
 
@@ -302,6 +303,7 @@ def main(argv):
     except Exception, e:
       traceback.print_exc()
       plog("WARN", "Can't connect to Tor: "+str(e))
+      sys.exit(SIGKILL)
 
     if db_url:
       hdlr.attach_sql_listener(db_url)

comment:3 Changed 6 years ago by aagbsn

Resolution: fixed
Status: newclosed

looks like this was fixed in:
9d79bc4f54acb40b4de7c2871884c2c04b2ab690

Note: See TracTickets for help on using tickets.