[tor-bugs] #8399 [Torflow]: Torflow traceback: ZeroDivisionError: float division

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Mar 5 18:57:24 UTC 2013


#8399: Torflow traceback: ZeroDivisionError: float division
---------------------+------------------------------------------------------
 Reporter:  arma     |          Owner:  aagbsn
     Type:  defect   |         Status:  new   
 Priority:  normal   |      Milestone:        
Component:  Torflow  |        Version:        
 Keywords:           |         Parent:        
   Points:           |   Actualpoints:        
---------------------+------------------------------------------------------

Comment(by aagbsn):

 Just ran into this myself. I'm not sure why self.desc_bw or self.bw is
 ever 0, but perhaps a hack like:
 {{{
 diff --git a/TorCtl.py b/TorCtl.py
 index 485a2d9..9bba58d 100755
 --- a/TorCtl.py
 +++ b/TorCtl.py
 @@ -510,8 +510,9 @@ class Router:

    def get_unmeasured_bw(self):
      # if unmeasured, the ratio of self.bw/self.desc_bw should be 1.0
 -    if self.unmeasured: return self.bw
 -    else: return self.desc_bw
 +    if self.unmeasured and self.bw > 0: return self.bw
 +    elif self.desc_bw > 0: return self.desc_bw
 +    else: return 1

  class Connection:
    """A Connection represents a connection to the Tor process via the
 }}}

 would do the trick

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8399#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list