[tor-bugs] #29351 [Core Tor/Stem]: BandwidthFile TypeError when initializing or accessing attributes

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Feb 7 08:20:42 UTC 2019


#29351: BandwidthFile TypeError when initializing or accessing attributes
---------------------------+------------------------
 Reporter:  juga           |          Owner:  atagar
     Type:  defect         |         Status:  new
 Priority:  Medium         |      Milestone:
Component:  Core Tor/Stem  |        Version:
 Severity:  Normal         |     Resolution:
 Keywords:  tor-bwauth     |  Actual Points:
Parent ID:                 |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+------------------------

Comment (by juga):

 Replying to [comment:1 atagar]:
 > Hi juga, there's several ways of creating a descriptor depending on what
 you are making it from...
 >
 > = String Descriptor Content =
 >
 > {{{
 > >>> from stem.descriptor.bandwidth_file import BandwidthFile
 > >>> content = """1523911758
 > ... node_id=$68A483E05A2ABDCA6DA5A3EF8DB5177638A27F80 bw=760
 nick=Test"""
 > >>> bwfile = BandwidthFile.from_str(content)
 > >>> bwfile.measurements
 > {u'68A483E05A2ABDCA6DA5A3EF8DB5177638A27F80': {u'nick': u'Test',
 u'node_id': u'$68A483E05A2ABDCA6DA5A3EF8DB5177638A27F80', u'bw': u'760'}}
 > }}}

 Hmm, weird, doing the same, i get from `bwfile.measurements` an empty
 dictionary (all the attributes are empty or None except `_raw_contents`).
 What i'm doing wrong this time?

 The other examples work. Sorry i didn't read the docs.

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


More information about the tor-bugs mailing list