Message244626
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? |
|
Date |
User |
Action |
Args |
2015-06-02 01:03:01 | josh.r | set | recipients:
+ josh.r |
2015-06-02 01:03:01 | josh.r | set | messageid: <1433206981.32.0.719516838977.issue24358@psf.upfronthosting.co.za> |
2015-06-02 01:03:01 | josh.r | link | issue24358 messages |
2015-06-02 01:03:00 | josh.r | create | |
|