Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #29332

Closed
Open
Opened Feb 05, 2019 by juga @juga💬

bandwidth_file.py test fails with TypeError in Python 3.5

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#29332