Message 315651 - Python tracker

Message315651

Author pekka.klarck
Recipients docs@python, josh.r, pekka.klarck
Date 2018-04-23.08:23:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524471824.82.0.682650639539.issue33319@psf.upfronthosting.co.za>
In-reply-to
Content
My goal is to read stdout. It's good to hear `subprocess.run()` is deadlock-safe and I can use it safely. Making the docs explicit about it so that others know it's safe would in my opinion be a good idea as well.

Casual users don't know `run()` it uses `communicate()`, not `wait()`, internally, or even that this would mean it cannot deadlock. The current situation when the docs say that `call()` shouldn't be used with `stdout=PIPE` and that `call(...)` is equivalent to `run(...).returncode` indicates `stdout=PIPE` is unsafe with `run()` as well.

A separate questions is that if `call(...)` is equivalent to `run(...).returncode`, should it also be implemented that way. Based on this discussion it would avoid the problem with `stdout=PIPE` also in that case.
History
Date User Action Args
2018-04-23 08:23:44pekka.klarcksetrecipients: + pekka.klarck, docs@python, josh.r
2018-04-23 08:23:44pekka.klarcksetmessageid: <1524471824.82.0.682650639539.issue33319@psf.upfronthosting.co.za>
2018-04-23 08:23:44pekka.klarcklinkissue33319 messages
2018-04-23 08:23:44pekka.klarckcreate