Martin Panter added the comment:

Where would you draw the line though? At one extreme, BufferedWriter is a 
wrapper, but if you removed BufferedWriter.fileno() it would break all the code 
that does

with open(os.devnull, "wb") as null:
    proc = subprocess.Popen(..., stdout=null)

Would you remove it from HTTPResponse? Some HTTP responses can be chunked, so 
the child process would see the chunk headers using fileno(). But other HTTP 
responses are more direct and would work smoothly with the subprocess module.

Considering the compatibility problems and other possible uses of fileno(), I 
suspect removing it would be a bad idea. “Throwing the baby out with the 
bathwater” comes to mind. A less drastic change would be to require an explicit 
fileno() call and only passing the file descriptor to subprocess.

There is already a bug open for improving the documentation: Issue 19992

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24358>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to