Commit 73d817dc authored by Jason Madden's avatar Jason Madden

socket.sendto needs to use self.timeout or it gets the global timeout exception. Fixes #634.

parent 96a641f0
......@@ -22,6 +22,14 @@ Unreleased
~630MB/s). See this `pypy bug`_ for details.
- Fix a possible ``TypeError`` when calling ``gevent.socket.wait``.
Reported in #635 by lanstin.
- ``gevent.socket.socket:sendto`` properly respects the socket's
blocking status (meaning in can raise EWOULDBLOCK now in cases it
wouldn't have before). Reported in :pr:`634` by Mike Kaplinskiy.
- Common lookup errors using the :mod:`threaded resolver
<gevent.resolver_thread>` are no longer always printed to stderr
since they are usually out of the programmer's control and caught
explicitly. (Programming errors like ``TypeError`` are still
printed.) Reported in :issue:`617` by Jay Oster and Carlos Sanchez.
.. _future: http://python-future.org
.. _bench_sendall.py: https://raw.githubusercontent.com/gevent/gevent/master/greentest/bench_sendall.py
......
......@@ -381,7 +381,7 @@ class socket(object):
try:
return sock.sendto(*args)
except error as ex:
if ex.args[0] != EWOULDBLOCK or timeout == 0.0:
if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0:
raise
sys.exc_clear()
self._wait(self._write_event)
......
......@@ -349,7 +349,7 @@ class socket(object):
try:
return _socket.socket.sendto(self._sock, *args)
except error as ex:
if ex.args[0] != EWOULDBLOCK or timeout == 0.0:
if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0:
raise
self._wait(self._write_event)
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment