[issue40885] Cannot pipe GzipFile into subprocess

2021-10-22 Thread Michael Herrmann
Michael Herrmann added the comment: I just encountered what seems to be the inverse problem of this issue: #45585 -- nosy: +mherrmann.at ___ Python tracker ___ ___

[issue40885] Cannot pipe GzipFile into subprocess

2020-06-06 Thread Nehal Patel
Nehal Patel added the comment: In my use case, I was actually trying to stream a large gzip file from the cloud directly into subprocess without spilling onto disk or RAM i.e. the code actually looked something more like: r, w = os.pipe() # ... launch a thread to feed r with gzip.open(os.fd

[issue40885] Cannot pipe GzipFile into subprocess

2020-06-06 Thread SilentGhost
SilentGhost added the comment: > subprocess somehow gets a hold of the underlying file descriptor pointing to > the compressed file, and ends up being fed the compressed bytes That is exactly what happens, and I'd wager this is not going to change. You could easily pass the decoded bytes int

[issue40885] Cannot pipe GzipFile into subprocess

2020-06-05 Thread Nehal Patel
New submission from Nehal Patel : The following code produces incorrect behavior: with gzip.open("foo.gz") as gz: res = subprocess.run("cat", stdin=gz, capture_output=True) the contents of res.stdout are identical to the contents of "foo.gz" It seems the subprocess somehow gets a hold of