Opened 3 years ago

Closed 4 months ago

#23043 closed defect (wontfix)

leekspin's except/error code handling in is strange

Reported by: Samdney Owned by:
Priority: Low Milestone:
Component: Circumvention/BridgeDB Version:
Severity: Minor Keywords: leekspin
Cc: Actual Points:
Parent ID: #23333 Points: 0.5
Reviewer: Sponsor:


In /leekspin/ you have in "def createRelayOrBridgeDescriptors(...)"

Code highlighting:

def createRelayOrBridgeDescriptors(count, bridge=True, **kwargs):
  except KeyboardInterrupt as keyint:
    logging.warn("Received keyboard interrupt.")
    logging.warn("Stopping descriptor creation and exiting.")
    code = 1515
    code = 0

The same in a similiar way also in "def createHiddenServiceDescriptors(...)"

I think your way of handling the code-variable isn't right. If you have an Keyboard exception if follows: code = 1515. But the "try ... except ... finally" - block always "finally" execute the code within the finally block. So it will always exit with code = 0, sys.exit(0)!

In generally, the execution of (some) parts of the finally block after an keyboard interruption makes no sense for me.

(I haven't found time to examinate the full source code until now. Hence, for the case that all has a good reason, please ignore me :)

Child Tickets

Change History (5)

comment:1 Changed 3 years ago by Samdney

Parent ID: #23333

comment:2 Changed 17 months ago by gaba

Owner: isis deleted
Sponsor: Sponsor19
Status: newassigned

comment:3 Changed 17 months ago by gaba

Points: 0.5

comment:4 Changed 15 months ago by arma

Sponsor: Sponsor19
Status: assignednew

disconnecting the ticket from sponsor19

we might want to abandon leekspin (or rather, acknowledge that we've already abandoned it) and close all of its tickets. but that can be a separate decision.

comment:5 Changed 4 months ago by phw

Resolution: wontfix
Status: newclosed

I'm closing this ticket because #22755 is now implemented and BridgeDB is no longer using leekspin.

Note: See TracTickets for help on using tickets.