New submission from Josh Rosenberg:

subprocess, when accepting objects for stdin, stdout, and stderr, assumes that 
possessing a .fileno() means it's a legitimate object for use with the forked 
process; that the file descriptor is interchangeable with the object itself. 
But gzip, bz2 and lzma file-like objects all violate this rule; they provide 
.fileno(), but it's unadorned. Providing .fileno() on these objects is 
misleading, since they produce the uncompressed data (likely useless) which 
causes subprocess to pass the "wrong" data to the subprocess, or write 
uncompressed data from the process (the exception being processes that expect 
compressed data from stdin or write compressed data to stdout, but that usually 
just means the compressor utilities themselves).

Is subprocess's assumption about fileno() (that you can read equivalent data 
from it, modulo issues with flushing/seeking) intended? If so, should .fileno() 
be removed from the compressed file interfaces? If not, should subprocess 
attempt to perform further checking, document this wart, or something else?

----------
components: IO
messages: 244626
nosy: josh.r
priority: normal
severity: normal
status: open
title: Should compression file-like objects provide .fileno(), misleading 
subprocess?
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

_______________________________________
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