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
  • #29899

Closed
Open
Opened Mar 26, 2019 by juga @juga💬

Descriptor exit_policy can raise TypeError?

In sbws we got this traceback:

  File "/usr/lib/python3/dist-packages/sbws/lib/relaylist.py", line 117, in can_exit_to_port
     if not self.exit_policy:
  File "/usr/lib/python3/dist-packages/stem/exit_policy.py", line 512, in __len__  # noqa
    return len(self._get_rules())
  File "/usr/lib/python3/dist-packages/stem/exit_policy.py", line 464, in _get_rules  # noqa
    for rule in decompressed_rules:
TypeError: 'NoneType' object is not iterable

I'm a bit confused on what triggers that, because looking at stem code, it does not seem that __init__ calls _get_rules, but this seems to happen when just getting the exit_policy attribute in sbws: https://github.com/torproject/sbws/blob/master/sbws/lib/relaylist.py#L92.

In the moment _get_rules is call, this might happen because it is not check that _input_rules is not None: https://github.com/torproject/stem/blob/master/stem/exit_policy.py#L462?

Should also _input_rules be assigned [] instead of None in https://github.com/torproject/stem/blob/master/stem/exit_policy.py#L507?

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#29899