[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #29351 [Core Tor/Stem]: BandwidthFile TypeError when initializing or accessing attributes
#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 | Keywords: tor-bwauth
Actual Points: | Parent ID:
Points: | Reviewer:
Sponsor: |
-------------------------------+------------------------
I obtain the same error both in Python 2.7 and 3.5.
Maybe i'm doing something wrong
{{{
>>> from stem.descriptor import bandwidth_file
>>> content = """1523911758
... node_id=$68A483E05A2ABDCA6DA5A3EF8DB5177638A27F80 bw=760 nick=Test"""
>>> bwfile = bandwidth_file.BandwidthFile(content, validate=True)
Traceback (most recent call last):
File "<ipython-input-3-54b8af3f518d>", line 1, in <module>
bwfile = bandwidth_file.BandwidthFile(content, validate=True)
File "/home/dev/stem/stem/descriptor/bandwidth_file.py", line 262, in
__init__
_parse_timestamp(self, None)
File "/home/dev/stem/stem/descriptor/bandwidth_file.py", line 132, in
_parse_timestamp
first_line = io.BytesIO(descriptor.get_bytes()).readline().strip()
TypeError: a bytes-like object is required, not 'str'
>>> bwfile = bandwidth_file.BandwidthFile(content)
>>> bwfile.header
Traceback (most recent call last):
File "<ipython-input-5-0fc01c24bd9c>", line 1, in <module>
bwfile.header
File "/home/user/_my/code/bwauth-
related/stem/stem/descriptor/__init__.py", line 1041, in __getattr__
parsing_function(self, self._entries)
File "/home/dev/stem/stem/descriptor/bandwidth_file.py", line 105, in
_parse_header
content = io.BytesIO(descriptor.get_bytes())
TypeError: a bytes-like object is required, not 'str'
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29351>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs