BandwidthFile TypeError when initializing or accessing attributes
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'