This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients josh.r
Date 2015-06-02.01:03:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1433206981.32.0.719516838977.issue24358@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2015-06-02 01:03:01josh.rsetrecipients: + josh.r
2015-06-02 01:03:01josh.rsetmessageid: <1433206981.32.0.719516838977.issue24358@psf.upfronthosting.co.za>
2015-06-02 01:03:01josh.rlinkissue24358 messages
2015-06-02 01:03:00josh.rcreate