Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

transport_received() takes 2 positional arguments but 3 were given #48

Closed
qstokkink opened this issue May 14, 2024 · 2 comments · Fixed by #49
Closed

transport_received() takes 2 positional arguments but 3 were given #48

qstokkink opened this issue May 14, 2024 · 2 comments · Fixed by #49
Assignees
Labels
bug Something isn't working

Comments

@qstokkink
Copy link
Owner

After the type refactorings the following error gets logged:

Traceback (most recent call last):
  File "C:\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Python310\lib\asyncio\proactor_events.py", line 585, in _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:\TriblerExperimental\src\tribler\core\socks5\client.py", line 61, in datagram_received
    self.callback(request.data, request.destination)
TypeError: UdpSocketManager.transport_received() takes 2 positional arguments but 3 were given
@qstokkink qstokkink added the bug Something isn't working label May 14, 2024
@qstokkink
Copy link
Owner Author

qstokkink commented May 14, 2024

transport = self.proxy_transports.get(proxy, Socks5Client(proxy, self.transport_received))

This should be self.datagram_received instead of self.transport_received.

@qstokkink qstokkink self-assigned this May 15, 2024
@qstokkink
Copy link
Owner Author

PyCharm does seem to detect this violation correctly:

screenshot

This must be a MyPy bug/shortcoming.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant