[issue21454] asyncio's loop.connect_read_pipe makes pipes non-blocking contrary to the documentation

John Isidore report at bugs.python.org
Thu May 8 21:05:06 CEST 2014


New submission from John Isidore:

the documentation for BaseEventLoop.connect_read_pipe says: 

> "pipe is file-like object **already switched** to nonblocking."

http://hg.python.org/cpython/file/232938736a31/Doc/library/asyncio-eventloop.rst#l453

But it looks like connect_read_pipe() accepts blocking pipes and switches
them to non-blocking mode:

> "It looks like connect_read_pipe() (eventually) sets the fd to non-blocking. So it does work."

https://code.google.com/p/tulip/source/detail?r=0a716436176993a12cf861b6cafffe8a31bc1127

If it is indeed the case then the documentation should mention that it
accepts blocking pipes and makes them non-blocking.

May it break other processes by making the file non-blocking if it is a pty
that is shared between processes? 

Related: "Don't set shared file descriptors to non-blocking I/O mode."
http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/dont-set-shared-file-descriptors-to-non-blocking-mode.html

----------
assignee: docs at python
components: Documentation
messages: 218120
nosy: John Isidore, docs at python, gvanrossum
priority: normal
severity: normal
status: open
title: asyncio's loop.connect_read_pipe makes pipes non-blocking contrary to the documentation
type: behavior
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21454>
_______________________________________


More information about the Python-bugs-list mailing list