[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-23 Thread STINNER Victor
STINNER Victor added the comment: As suggested by Antoine, I created the issue #22054 to add os.get_blocking() and os.set_blocking() functions. Here is the simplified patch for signal.set_wakeup_fd(fd). It now depends on the patch of the issue #22054. -- Added file: http://bugs.python

[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9dc66b3a1d0d by Victor Stinner in branch 'default': Issue #22042: Avoid dangerous C cast in socket.setblocking() http://hg.python.org/cpython/rev/9dc66b3a1d0d -- nosy: +python-dev ___ Python tracker

[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-22 Thread STINNER Victor
STINNER Victor added the comment: "Also, given set_wakeup_fd() is rather specialized and uncommon, I don't see much point in making it more convenient." The problem is that passing a blocking file descriptor can block the whole Python process. The hang does not occur immediatly, but only when

[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think it would be much better to expose a generic function to make a fd non-blocking, rather than bake it inside signal.set_wakeup_fd(). Also, given set_wakeup_fd() is rather specialized and uncommon, I don't see much point in making it more convenient. ---

[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-22 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +neologix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-22 Thread STINNER Victor
New submission from STINNER Victor: I think that signal.set_wakeup_fd(fd) must set the file descriptor to the non-blocking mode, instead of requiring the file descriptor mode to be non-blocking. Atttached patch implements this idea. See also the issue #22018 which proposes to support sockets