[tor-bugs] #24705 [Core Tor/Stem]: stem's get_consensus().run() always returns a list, but DocumentHandler implies it returns an object

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Dec 22 01:46:27 UTC 2017


#24705: stem's get_consensus().run() always returns a list, but DocumentHandler
implies it returns an object
-------------------------------+--------------------
     Reporter:  teor           |      Owner:  atagar
         Type:  defect         |     Status:  new
     Priority:  Medium         |  Milestone:
    Component:  Core Tor/Stem  |    Version:
     Severity:  Normal         |   Keywords:
Actual Points:                 |  Parent ID:
       Points:                 |   Reviewer:
      Sponsor:                 |
-------------------------------+--------------------
 When I read the stem DocumentHandler documentation for DOCUMENT, it syas
 that it returns a NetworkStatusDocument:

 https://stem.torproject.org/api/descriptor/descriptor.html#stem.descriptor.__init__.DocumentHandler

 But when I call:
 {{{
 stem.descriptor.remote.get_consensus(document_handler='DOCUMENT').run()
 }}}

 It actually returns a list of NetworkStatusDocuments with one entry.

 I understand why this happens (you might be reading a list of
 consensuses), but it's confusing.

 Please document this behaviour in one or more of get_consensus(), run(),
 or DocumentHandler DOCUMENT/BARE_DOCUMENT.

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


More information about the tor-bugs mailing list