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 Nehal Patel
Recipients Nehal Patel, SilentGhost, giampaolo.rodola
Date 2020-06-06.12:44:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591447488.22.0.113630791363.issue40885@roundup.psfhosted.org>
In-reply-to
Content
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.fdopen(w, 'rb')) as gz:
    res = subprocess.run("myexe", stdin=gz, capture_output=True)
## fyi, expected output is tiny
 
(In my case, I could modify the executable to expect compressed input, so I chose that solution.  Another possibility would have been to use subprocess.POpen twice, once with  'gzcat' and second with 'myexe')

I agree that given how libgz works, it would be difficult to fix the  problem.  I would suggest finding a way to alert the user about this issue because it will in general be a very confusing situation when this happens.
History
Date User Action Args
2020-06-06 12:44:48Nehal Patelsetrecipients: + Nehal Patel, giampaolo.rodola, SilentGhost
2020-06-06 12:44:48Nehal Patelsetmessageid: <1591447488.22.0.113630791363.issue40885@roundup.psfhosted.org>
2020-06-06 12:44:48Nehal Patellinkissue40885 messages
2020-06-06 12:44:47Nehal Patelcreate