Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDPTransport AttributeError #207

Closed
amelchio opened this issue Nov 4, 2018 · 3 comments
Closed

UDPTransport AttributeError #207

amelchio opened this issue Nov 4, 2018 · 3 comments

Comments

@amelchio
Copy link

amelchio commented Nov 4, 2018

  • uvloop version: 0.11.2
  • Python version: 3.6
  • Platform: Linux
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: Unknown

This error was reported in a forum post:

File “uvloop/handles/udp.pyx”, line 157, in uvloop.loop.UDPTransport.sendto
AttributeError: ‘uvloop.loop.UDPTransport’ object has no attribute ‘_address’

It seems like the attribute should be address, not _address.

@1st1
Copy link
Member

1st1 commented Nov 28, 2018

Thanks for submitting this. Care to make a PR?

@amelchio
Copy link
Author

Not really. I am not set up for uvloop development and I don't even know how to reproduce the problem.

@jlaine
Copy link
Contributor

jlaine commented Jan 9, 2019

This looks like a real bug, still present in the current code:

if self._conn_lost and self._address:

I don't understand why we need to check self.address at all to be honest. As far as I can tell, the only way for _conn_lost to be set for UDPTransport is if close() or _force_close() was called. This is not dependent on whether a remote address was provided when creating the endpoint.

jlaine added a commit to jlaine/uvloop that referenced this issue Jan 9, 2019
…tack#207)

If the sendto() method is called after closing the transport, it bombs
with an AttributeError as there is no `._address` attribute. Replacing
this by `.address` is not a solution either, as we need to exit in any
case otherwise the call to sendto() bombs again due to `.sock` having
been set to None.
@1st1 1st1 closed this as completed in f24c2c5 Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants