meejah / txtorcon

Twisted-based asynchronous Tor control protocol implementation. Includes unit-tests, examples, state-tracking code and configuration abstraction.
http://fjblvrw2jrxnhtg67qpbzi45r7ofojaoo3orzykesly2j3c2m3htapid.onion/
MIT License
249 stars 72 forks source link

attribute-error on python 3.9 #350

Closed meejah closed 3 years ago

meejah commented 3 years ago

Reported via a user running the test-suite with py.test:

Traceback (most recent call last):
  File "/nix/store/917dzvfd7shvfzx827gp2gxlgd8ip49r-python3.9-Twisted-21.7.0/lib/python3.9/site-packages/twisted/internet/defer.py", line 858, in _runCallbacks
    current.result = callback(  # type: ignore[misc]
  File "/build/txtorcon-20.0.0/txtorcon/torinfo.py", line 220, in bootstrap
    d.addCallback(self._setup_complete)
  File "/nix/store/917dzvfd7shvfzx827gp2gxlgd8ip49r-python3.9-Twisted-21.7.0/lib/python3.9/site-packages/twisted/internet/defer.py", line 498, in addCallback
    return self.addCallbacks(callback, callbackArgs=args, callbackKeywords=kwargs)
  File "/nix/store/917dzvfd7shvfzx827gp2gxlgd8ip49r-python3.9-Twisted-21.7.0/lib/python3.9/site-packages/twisted/internet/defer.py", line 478, in addCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/nix/store/917dzvfd7shvfzx827gp2gxlgd8ip49r-python3.9-Twisted-21.7.0/lib/python3.9/site-packages/twisted/internet/defer.py", line 858, in _runCallbacks
    current.result = callback(  # type: ignore[misc]
  File "/build/txtorcon-20.0.0/txtorcon/torinfo.py", line 285, in _setup_complete
    pb.callback(self)
  File "/nix/store/917dzvfd7shvfzx827gp2gxlgd8ip49r-python3.9-Twisted-21.7.0/lib/python3.9/site-packages/twisted/internet/defer.py", line 661, in callback
    assert not isinstance(result, Deferred)
  File "/nix/store/81lwy2hfqj4c1943b1x8a0qsivjhdhw9-python3-3.9.6/lib/python3.9/abc.py", line 119, in __instancecheck__
    return _abc_instancecheck(cls, instance)
  File "/build/txtorcon-20.0.0/txtorcon/torinfo.py", line 213, in __getattribute__
    raise AttributeError(name)
builtins.AttributeError: __class__

self = <test.test_web.WebAgentTests testMethod=test_agent>
result = <TestCaseFunction test_agent>

    def run(self, result):
        """
        Run the test case, storing the results in C{result}.

        First runs C{setUp} on self, then runs the test method (defined in the
        constructor), then runs C{tearDown}.  As with the standard library
        L{unittest.TestCase}, the return value of these methods is disregarded.
        In particular, returning a L{Deferred<twisted.internet.defer.Deferred>}
        has no special additional consequences.

        @param result: A L{TestResult} object.
        """
        log.msg("--> %s <--" % (self.id()))
        new_result = itrial.IReporter(result, None)
        if new_result is None:
            result = PyUnitResultAdapter(result)
        else:
            result = new_result
        result.startTest(self)
        (doSkip, skipReason) = self.getSkip()
        if doSkip:  # don't run test methods that are marked as .skip
>           result.addSkip(self, skipReason)
E           TypeError: Skipped expected string as 'msg' parameter, got 'bool' instead.
E           Perhaps you meant to use a mark?