[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #29332 [Core Tor/Stem]: bandwidth_file.py test fails with TypeError in Python 3.5
#29332: bandwidth_file.py test fails with TypeError in Python 3.5
-------------------------------+------------------------
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: |
-------------------------------+------------------------
When `pytest test/unit/descriptor/bandwidth_file.py` is run in a Python
3.5 environment, it fails with the error:
{{{
descriptor = <stem.descriptor.bandwidth_file.BandwidthFile object at
0x7f6a8c41b9b0>, entries = None
def _parse_header(descriptor, entries):
header = OrderedDict()
content = io.BytesIO(descriptor.get_bytes())
content.readline() # skip the first line, which should be the
timestamp
while True:
line = content.readline().strip()
if not line:
break # end of the content
elif line in (HEADER_DIV, HEADER_DIV_ALT):
break # end of header
> elif not header and 'node_id=' in line:
E TypeError: a bytes-like object is required, not 'str'
stem/descriptor/bandwidth_file.py:116: TypeError
}}}
It seems something is missing with the bytes/str python 2/3 compatibility.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29332>
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