summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Johnson <atagar@torproject.org>2019-02-05 13:41:55 -0800
committerDamian Johnson <atagar@torproject.org>2019-02-05 13:41:55 -0800
commitf1c6e30dbb9ca739df3b577bf0a5f547d5383b3a (patch)
tree260f82b6b4dfd0df3221e0e3a7c769cf3fbeb1d2
parent3895bf0e0ec81504ec0a4ea34c8768a80ca910bb (diff)
BandwidthFile python 3.x regression
Oops, forgot to re-run tests with python 3.x. Recent change had a bytes/unicode regression slip in... https://trac.torproject.org/projects/tor/ticket/29332 ====================================================================== ERROR: test_format_v1_2 ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/atagar/Desktop/stem/test/unit/descriptor/bandwidth_file.py", line 103, in test_format_v1_2 self.assertEqual('1.2.0', desc.version) File "/home/atagar/Desktop/stem/stem/descriptor/__init__.py", line 1041, in __getattr__ parsing_function(self, self._entries) File "/home/atagar/Desktop/stem/stem/descriptor/bandwidth_file.py", line 116, in _parse_header elif not header and 'node_id=' in line: TypeError: a bytes-like object is required, not 'str'
-rw-r--r--stem/descriptor/bandwidth_file.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/stem/descriptor/bandwidth_file.py b/stem/descriptor/bandwidth_file.py
index e2a420ef..f73dc007 100644
--- a/stem/descriptor/bandwidth_file.py
+++ b/stem/descriptor/bandwidth_file.py
@@ -113,7 +113,7 @@ def _parse_header(descriptor, entries):
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:
+ elif not header and b'node_id=' in line:
break # version 1.0 doesn't have any headers
if b'=' in line: