[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] get_circuit() failed with integer circuit ids



commit 2dde4f69ed3e7c4fff66eb754bf4e070bf080a04
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Fri Aug 7 17:38:09 2020 -0700

    get_circuit() failed with integer circuit ids
    
    Our get_circuit() method is documented as taking an integer circuit id, but our
    CircuitEvent class uses string id attributes. As a result calling with an int
    argument would always fail with 'Tor currently does not have a circuit with the
    id of x' error.
    
    Caught thanks to Joel.
---
 stem/control.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/control.py b/stem/control.py
index d77eb311..9efc6e04 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -3505,7 +3505,7 @@ class Controller(BaseController):
     """
 
     for circ in await self.get_circuits():
-      if circ.id == circuit_id:
+      if circ.id == str(circuit_id):
         return circ
 
     raise ValueError("Tor currently does not have a circuit with the id of '%s'" % circuit_id)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits