#24705 closed defect (fixed)

stem's get_consensus().run() always returns a list, but DocumentHandler implies it returns an object

Reported by: teor Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

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.

Child Tickets

Change History (1)

comment:1 Changed 16 months ago by atagar

Resolution: fixed
Status: newclosed

Hi Tim. I certainly understand the confusion. Added a bit to explain it...

https://gitweb.torproject.org/stem.git/tree/stem/descriptor/__init__.py#n22

Note: See TracTickets for help on using tickets.